RFR: JDK-8260332: ParallelGC: Cooperative pretouch for oldgen expansion [v2]

Amit Pawar github.com+71302734+amitdpawar at openjdk.java.net
Tue Mar 16 06:39:07 UTC 2021


On Mon, 15 Mar 2021 02:07:27 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

>> src/hotspot/share/gc/shared/pretouchTask.cpp line 94:
>> 
>>> 92: 
>>> 93:   if (thread_num == 0) {
>>> 94:     Atomic::release_store(&_cur_addr, _end_addr);
>> 
>> The release is unnecessary given the Atomic::sub.
>
> Besides what David said, I think this is also confusing.  I think it's to account for the claim (using fetch_and_add) unconditionally adding the chunk size to cur_addr, which could lead to overshoot.  I think it would be clearer to prevent the overshoot from occurring.

David, will update as suggested.

Kim, thanks for your feedback. Updating **_cur_addr** was not needed here but thought to keep the markers in clean state. Again, **_cur_addr** & **_end_addr** gets updated before the start of next pretouch resize so will remove this. If something breaks then will fix as suggested. I hope this should be OK.

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

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


More information about the hotspot-dev mailing list