Perf: excess store in allocation fast path?

Roman Kennke rkennke at redhat.com
Tue Dec 6 19:55:17 UTC 2016


Am Dienstag, den 06.12.2016, 20:50 +0100 schrieb Aleksey Shipilev:
> On 12/06/2016 08:44 PM, Roman Kennke wrote:
> > Try the attached patch. It preserves the obj_size, and passes that
> > to
> > initialize_object().
> 
> Yea, that works, see:
> 
> http://cr.openjdk.java.net/~shade/shenandoah/alloc-excess-store/alloc
> -shenandoah-rkennke1.txt
> 
> Compare with baseline:
> 
> http://cr.openjdk.java.net/~shade/shenandoah/alloc-excess-store/alloc
> -shenandoah.txt
> 
> ...and have your 50 picoseconds per alloc back!
> 
> Now, I want to know if it's okay to skip zeroing memory past the
> allocation
> pointer. I think it is safe, because that's how zeroing elimination
> works in
> other cases?

It's not only ok, I think it is a bug to zero past the allocation ptr.
Consider what happens when you allocate at the region boundary, and
then initialize one word past the object -> we'd wreck the 1st word of
the next region.

Roman


More information about the shenandoah-dev mailing list