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

Aleksey Shipilev shade at openjdk.org
Thu Feb 8 18:41:02 UTC 2024


On Thu, 8 Feb 2024 18:24:09 GMT, William Kemper <wkemper 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.

The move looks good, but I think it introduces a bug.

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()`?

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

PR Review: https://git.openjdk.org/jdk/pull/17777#pullrequestreview-1870974321
PR Review Comment: https://git.openjdk.org/jdk/pull/17777#discussion_r1483424226


More information about the hotspot-gc-dev mailing list