[jdk19] RFR: 8290250: Shenandoah: disable Loom for iu mode

Erik Osterlund erik.osterlund at oracle.com
Fri Jul 15 06:04:44 UTC 2022


Hi Ramki,

If memory serves well, CMS used ”deferred card marking”, to colour allocations into the old generation grey, at a subsequent allocation or in a subsequent safepoint. The important effect of that is that they were coloured grey, before marking terminates, yet importantly after the initializing stores I just described, which would have their barriers elided in C2. So the GC would read the fields after the initializing stores have become visible.

As for Shenandoah IU, I’m not sure if the approach is described somewhere. But my understanding is that instead of first writing a new value to a field, and then handing the address of the field to the GC, so that it can read this new value, Shenandoah hands the new value to the GC directly. So rather than colouring the containing object of the field grey, it colours the new value grey. New allocations are black. And that is fine if you don’t elide barriers on newly allocated objects. If initializing stores elide barriers though, the newly allocated object needs to be asynchronously grey, like CMS (due to deferred card marking for old objects and due to subsequent YC for young objects).

There is AFAICT no such code, and I think the assumption is that elisions are not happening on newly allocated objects, but I think that they are happening, for initializing stores in C2. At least I can’t see what would stop that machinery from removing the barriers.

/Erik

> On 15 Jul 2022, at 01:55, Y.Srinivas Ramakrishna <ysr at openjdk.org> wrote:
> 
> On Wed, 13 Jul 2022 18:39:51 GMT, Zhengyu Gu <zgu at openjdk.org> wrote:
> 
>> Please review this trivial patch to disable Loom for Shenandoah iu mode (an experimental feature).
>> 
>> Test:
>> - [x] hotspot_gc_shenandoah
>> - [x] jdk_loom with Shenandoah + iu
>> - [x] hotspot_loom with Shenandoah + iu
> 
> CMS collected only old gen, and direct allocations in old gen were grey, and so would updates of black objects in old gen. I assume new objects in Shenandoah would also be grey as would be updates of those objects? (That would be the classical IU scheme in my understanding.)
> 
> I should read the Vechev paper though. Is the Shenandoah treatment of new allocations described anywhere for the IU case?
> 
> -------------
> 
> PR: https://git.openjdk.org/jdk19/pull/140


More information about the hotspot-gc-dev mailing list