RFR: 8280396: G1: Full gc mark stack draining should prefer to make work available to other threads [v2]

Stefan Johansson sjohanss at openjdk.java.net
Mon Jan 24 19:54:14 UTC 2022


On Mon, 24 Jan 2022 16:48:02 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

>> src/hotspot/share/gc/g1/g1FullGCMarker.inline.hpp line 162:
>> 
>>> 160:         follow_object(obj);
>>> 161:       }
>>> 162:     }
>> 
>> What do you think about instead of extracting all this into `drain_stack()` have something like `transfer_from_overflow()` as the first statement in in `pop_object()`? It would either return an object that can't be transferred or push it back to the overflow and just let pop do what it does today. 
>> 
>> The problem I see with that is that `pop_object(...)` would have side effects that you wouldn't really expect, so if doing that maybe we should call it `drain_object_stack(...)` or something like that.
>
> Refactored the code a bit, to hopefully something better.
> 
> I *think* there are some additional gains to be made by not draining the regular oop task queue fully when trying to move work from its overflow stack to the shared one, however measurements were within a few percent so far. I will file an issue for working on that idea - the current change is already much better than what has been there before.

I think this is better and I'm not too worried if this is not optimal. As you say, still a good improvement.

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

PR: https://git.openjdk.java.net/jdk/pull/7175



More information about the hotspot-gc-dev mailing list