RFR: 8323630: GenShen: Control thread may (still) ignore requests to start concurrent GC

William Kemper wkemper at openjdk.org
Fri Jan 12 16:45:14 UTC 2024


On Fri, 12 Jan 2024 02:07:19 GMT, Y. Srinivas Ramakrishna <ysr at openjdk.org> wrote:

>> A race condition exists in which the control thread may clear the `_requested_gc_cause` immediately after a mutator requests an explicit gc. When this happens, the control thread will no longer accept requests from the regulator to start concurrent GC cycles. The mutator thread will never wakeup, eventually the application will run out of memory or no progress will be made.
>> 
>> The change here is intended to simplify the thread communication protocol by reducing the number of variables in play.
>
> src/hotspot/share/gc/shenandoah/shenandoahControlThread.cpp line 123:
> 
>> 121: 
>> 122:     bool explicit_gc_requested = is_explicit_gc(cause);
>> 123:     bool implicit_gc_requested = is_implicit_gc(cause);
> 
> const them all.

`cause` is overwritten when there is an allocation failure or if we are resuming old mark, so it can't (easily) be made const. Will const the others though.

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

PR Review Comment: https://git.openjdk.org/shenandoah/pull/382#discussion_r1450690489


More information about the shenandoah-dev mailing list