RFR: 8248149: G1: change _cleaning_claimed from int to bool

Kim Barrett kbarrett at openjdk.org
Thu Jun 15 10:52:59 UTC 2023


On Thu, 15 Jun 2023 09:22:39 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

> Hi all,
> 
>   please review this change to fix some claim variable from `int` to `bool` as it should be.
> 
> Testing: gha
> 
> Thanks,
>   Thomas

src/hotspot/share/gc/g1/g1ParallelCleaning.cpp line 43:

> 41:   }
> 42: 
> 43:   return !Atomic::cmpxchg(&_cleaning_claimed, false, true);

It might be an int because making it a bool may involve a byte-sized cmpxchg, which has a not very
nice implementation on some platforms.  Though even with that the claim cost is likely dwarfed by
other costs here.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14487#discussion_r1230819175


More information about the hotspot-gc-dev mailing list