Perf: excess store in allocation fast path?

Aleksey Shipilev shade at redhat.com
Tue Dec 6 20:07:24 UTC 2016


On 12/06/2016 08:55 PM, Roman Kennke wrote:
> Am Dienstag, den 06.12.2016, 20:50 +0100 schrieb Aleksey Shipilev:
>> 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.

Hrmpf. IIRC our filler object mechanics correctly, we allocate the space at the
end of the object, so there is no way to cross into other region?

Anyhow, that one notwithstanding, I meant if it's okay to have non-zeroed slot
_under_ the allocation top, as in:

  (obj2 header would go here)
 ----------------------------------------- alloc top
  [garbage slot, soon to be obj2 fwdptr]
  [obj1 fields]
  [obj1 header]
  [obj1 fwdptr]
  ...

It's not likely to be parsable, but still.

Thanks,
-Aleksey



More information about the shenandoah-dev mailing list