RFR: 8323634: Shenandoah: Document behavior of EvacOOM protocol

William Kemper wkemper at openjdk.org
Fri Jan 12 22:28:19 UTC 2024


On Fri, 12 Jan 2024 01:14:24 GMT, Kelvin Nilsen <kdnilsen at openjdk.org> wrote:

> The protocol for handling OOM during evacuation is subtle and critical for correct operation.  This PR does NOT change behavior.  It provided improved documentation of existing behavior.

src/hotspot/share/gc/shenandoah/shenandoahEvacOOMHandler.cpp line 208:

> 206: //  3. The count of threads authorized to evacuate for allocation has been decremented, because this thread is no
> 207: //     longer authorized.
> 208: //  4. We have waited for all evacuating threads to stop allocating, after which it is safe for this thread to resolve

This is where I think the implementation breaks down. If thread `A` is the _first_ thread to attempt evacuation and it fails _before_ any other thread has attempted to evacuate, then thread `A` "believes" that no other threads are evacuating and it returns immediately. How does the protocol then prevent other threads from proceeding with evacuation.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17385#discussion_r1450980552


More information about the hotspot-gc-dev mailing list