Integrated: 8255471: ZGC: Rework root iterators and closures

Stefan Karlsson stefank at openjdk.java.net
Mon Nov 2 15:29:55 UTC 2020


On Thu, 29 Oct 2020 11:01:05 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.

This pull request has now been integrated.

Changeset: 1769c483
Author:    Stefan Karlsson <stefank at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/1769c483
Stats:     600 lines in 17 files changed: 248 ins; 202 del; 150 mod

8255471: ZGC: Rework root iterators and closures

Reviewed-by: eosterlund, pliden

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

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



More information about the hotspot-gc-dev mailing list