RFR (S): 8242036: G1 HeapRegionRemSet::_n_coarse_entries could be a bool

Albert Yang albert.m.yang at oracle.com
Thu Jul 23 12:29:34 UTC 2020


I misunderstood the original request from the internal discussion.

The variable is marked `volatile`, and access to it uses `Atomic::load/store`, or `Atomic::load_acquire/release_store` only when memory ordering is needed.

https://bugs.openjdk.java.net/browse/JDK-8242036

the complete patch:

http://cr.openjdk.java.net/~lkorinth/albert/8242036/2/

Tested: hotspot-gc

PS: My apologies for the inconvenience. 

/Albert

----- Original Message -----
From: albert.m.yang at oracle.com
To: hotspot-gc-dev at openjdk.java.net
Sent: Thursday, July 23, 2020 11:05:33 AM GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna
Subject: Re: RFR (S): 8242036: G1 HeapRegionRemSet::_n_coarse_entries could be a bool

Additionally, in following the guideline for concurrent variables, it is marked `volatile` to signal potential concurrent access, and all access to it use explicit atomic operations now.

https://bugs.openjdk.java.net/browse/JDK-8242036

the complete patch:

http://cr.openjdk.java.net/~lkorinth/albert/8242036/1/

Tested: hotspot-gc

/Albert

----- Original Message -----
From: albert.m.yang at oracle.com
To: hotspot-gc-dev at openjdk.java.net
Sent: Wednesday, July 22, 2020 11:51:57 AM GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna
Subject: RFR (S): 8242036: G1 HeapRegionRemSet::_n_coarse_entries could be a bool

Hi,

Changed the type from `size_t` to `bool`, since we only care whether if it's zero or not.

https://bugs.openjdk.java.net/browse/JDK-8242036

http://cr.openjdk.java.net/~lkorinth/albert/8242036/0/

/Albert



More information about the hotspot-gc-dev mailing list