RFR: 8255471: ZGC: Rework root iterators and closures [v4]

Per Liden pliden at openjdk.java.net
Mon Nov 2 13:28:10 UTC 2020


On Fri, 30 Oct 2020 11:18:55 GMT, Stefan Karlsson <stefank at openjdk.org> wrote:

>> Today we have the ZRootsIteratorClosure type to cater for the different type of roots and their containers (oop storage, threads, nmethods, runtime oop data structures). This closure is then passed down and applied to the different containers. We split the root sets into different sets: concurrent strong, concurrent weak, and non-concurrent weak. Not all of those sets contain all types of containers. This forces some of the code to implement, or at least consider, parts of the ZRootsIteratorClosure interface that it doesn't care about. It also moves some of the closure logic into shared code, even when it's only used by one of the closures.
>> 
>> I propose that we turn this inside out, and use direct closures that match the visited containers (NMethodClosure for nmethods, et.c.). The intention is to make it a bit easier to see from the call sites what code is run and, hopefully, making localized changes stay more local in the code.
>> 
>> Note: I started this code with a version building upon https://bugs.openjdk.java.net/browse/JDK-8212879, but I don't want to wait for that work to finish before sending this out, so the current patch contains handling of non-conurrent weak roots. As soon as that gets integrated, we can get rid of the ZWeakSerial and the associated non-concurrent weak roots handling.
>> 
>> I've tested this on tier1-7 on linux x64.
>
> Stefan Karlsson has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Only restrict nmethod verification when class unloading is turned off

Marked as reviewed by pliden (Reviewer).

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

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


More information about the hotspot-gc-dev mailing list