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

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


On Mon, 15 Mar 2021 01:43:38 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

>> Amit Pawar has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Fixed build issues for some targets and updated with suggested changes.
>
> src/hotspot/share/gc/parallel/psOldGen.cpp line 226:
> 
>> 224:         while (!pretouch()->is_task_done()) {
>> 225:           if (pretouch()->is_task_ready()) {
>> 226:             pretouch()->work(Thread::current()->osthread()->thread_id());
> 
> worker thread_id and os thread_id are entirely different things.  This is another indication that reusing (abusing) PretouchTask in this way is a mistake.

Is following change OK ?
pretouch()->work(static_cast<AbstractGangWorker*>(Thread::current())->id());

otherwise please suggest.

> src/hotspot/share/gc/shared/pretouchTask.cpp line 68:
> 
>> 66:   // visible to all threads from this points.
>> 67:   char *cur_addr = Atomic::load(&_cur_addr);
>> 68:   char *end_addr = Atomic::load(&_end_addr);
> 
> end needs to be read before cur.  Otherwise, cur could be from one pretouch instance and end could be from a later, unrelated, pretouch instance, leading to scribbling.

didn't realize this. will change per your suggestion.

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

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


More information about the hotspot-dev mailing list