RFR: JDK-8274249: ZGC: Bulk free empty relocated pages [v3]

Per Liden pliden at openjdk.java.net
Mon Oct 11 09:09:10 UTC 2021


On Wed, 29 Sep 2021 08:54:02 GMT, 王超 <github.com+25214855+casparcwang at openjdk.org> wrote:

>> Similar to JDK-8255237, bulk free empty relocated pages can amortize the cost of freeing a page and speed up the relocation stage.
>> 
>> The following is the result of specjbb2015 after applying the patch (the tests turn off  the option`UseDynamicNumberOfGCThreads`): the average relocation time speeds up 14%, and the max relocation time speeds up 18%.
>> 
>> patch:
>> [2021-09-18T13:11:51.736+0800][info][gc,stats    ]       Phase: Concurrent Relocate                           0.000 / 0.000       373.180 / 569.855     275.312 / 569.855     275.312 / 569.855     ms
>> [2021-09-18T15:30:07.168+0800][info][gc,stats    ]       Phase: Concurrent Relocate                           0.000 / 0.000       381.266 / 577.812     277.272 / 577.812     277.272 / 577.812     ms
>> [2021-09-18T17:37:56.305+0800][info][gc,stats    ]       Phase: Concurrent Relocate                           0.000 / 0.000       345.037 / 494.135     259.497 / 506.815     259.497 / 506.815     ms
>> 
>> 
>> origin:
>> [2021-09-18T01:01:32.897+0800][info][gc,stats    ]       Phase: Concurrent Relocate                           0.000 / 0.000       429.099 / 662.120     327.213 / 759.723     327.213 / 759.723     ms
>> [2021-09-18T03:11:10.433+0800][info][gc,stats    ]       Phase: Concurrent Relocate                           0.000 / 0.000       413.014 / 613.035     307.625 / 613.035     307.625 / 613.035     ms
>> [2021-09-18T05:21:12.743+0800][info][gc,stats    ]       Phase: Concurrent Relocate                           0.000 / 0.000       411.745 / 642.242     308.986 / 642.242     308.986 / 642.242     ms
>
> 王超 has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Change to version provided by per lidan

src/hotspot/share/gc/z/zRelocate.cpp line 161:

> 159: private:
> 160:   volatile size_t _in_place_count;
> 161:   ZPerWorker<ZArray<ZPage*>> _empty_pages;

You're right that `_empty_pages` needs to be worker local (or protected by a lock). However, you can't use `ZPerWorker` like you do here, since you would be allocating a new worker local storage every time we do relocation. A `ZPerWorker` instance is semi-static, i.e. can only be initialized once and it will never deallocated its backing storage.

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

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



More information about the hotspot-gc-dev mailing list