RFR: 8325516: Shenandoah: Move heap change tracking into ShenandoahHeap

William Kemper wkemper at openjdk.org
Thu Feb 8 19:39:03 UTC 2024


On Thu, 8 Feb 2024 18:36:59 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> Shenandoah sets a flag when new regions are allocated or retired. This flag currently resides in the control thread. Moving it into the heap reduces code duplication with upcoming generational mode changes.
>
> src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp line 837:
> 
>> 835: 
>> 836:   // This is called from allocation path, and thus should be fast.
>> 837:   if (_heap_changed.is_set()) {
> 
> Um. The old code tests `is_unset`, then does `set`. This one introduces a bug: it would be set when already set. Should maybe be just `_heap_changed.try_set()`?

Yikes. Good catch. I originally had `try_set` here, but then wanted to make it the same as the original code and wrote a typo! I'll go with `try_set`.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/17777#discussion_r1483504596


More information about the shenandoah-dev mailing list