RFR: 8294238: ZGC: Move CLD claimed mark clearing [v2]

Thomas Schatzl tschatzl at openjdk.org
Tue Oct 11 07:39:25 UTC 2022


On Thu, 6 Oct 2022 12:28:35 GMT, Stefan Karlsson <stefank at openjdk.org> wrote:

>> When we claim CLDs during object iteration, we must make sure to have a cleared set of claim bits. Today we ensure this by clearing the bits before object iteration starts. Most GCs perform this clearing during a stop-the-world pause, before the actual GC marking starts.
>> 
>> ZGC, however, performs the clearing concurrently. This requires us to be very careful and never start following object references before the clearing has completed.
>> 
>> In the Generational ZGC repository, we changed it so that the code that performs the object iteration cleans up and clears these bits after itself. This has the effect that when marking starts, we know that the claimed bits have been cleared.
>> 
>> I'd like to change the single-generation ZGC to do the same.
>
> Stefan Karlsson has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Guard verify_not_claimed with ifdef ASSERT

Marked as reviewed by tschatzl (Reviewer).

src/hotspot/share/classfile/classLoaderDataGraph.hpp line 69:

> 67:   static void clear_claimed_marks();
> 68:   static void clear_claimed_marks(int claim);
> 69:   static void verify_claimed_marks_cleared(int claim);

Is there a reason to not use `NOT_DEBUG_RETURN` for this method like for `ClassLoaderData::verify_not_claimed()`? I would prefer this to be consistent.

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

PR: https://git.openjdk.org/jdk/pull/10591


More information about the hotspot-dev mailing list