RFR: 8255235: ZGC: Allocate and initialize forwarding data structures in parallel [v2]
Albert Mingkun Yang
ayang at openjdk.java.net
Tue Oct 27 09:16:20 UTC 2020
On Fri, 23 Oct 2020 11:52:50 GMT, Per Liden <pliden at openjdk.org> wrote:
>> As a continuation of JDK-8255234, we can speed things up even more by allocating/initializing forwarding data structures in parallel. For example, testing using BigRamTester shows the time for "Concurrent Select Relocation Set" phase drop by ~50% when using 4 threads.
>>
>> This PR depends on "8255234: ZGC: Bulk allocate forwarding data structures", which is a separate PR (https://github.com/openjdk/jdk/pull/804).
>
> Per Liden has updated the pull request incrementally with two additional commits since the last revision:
>
> - Merge
> - Assert that allocations never fail
Only minor comments on additional asserts.
src/hotspot/share/gc/z/zRelocationSet.cpp line 47:
> 45: void install(ZForwarding* forwarding, volatile size_t* next) {
> 46: const size_t index = Atomic::fetch_and_add(next, 1u);
> 47: _forwardings[index] = forwarding;
Maybe `assert(index < _nforwardings)` before indexing the array?
src/hotspot/share/gc/z/zRelocationSet.cpp line 113:
> 111: ZRelocationSetInstallTask task(&_allocator, selector);
> 112: _workers->run_concurrent(&task);
> 113:
Now all space in `_allocator` is used; I wonder if it's worth placing an assert here, sth like `assert(_allocator.used() == _allocator.size())`.
-------------
Marked as reviewed by ayang (Author).
PR: https://git.openjdk.java.net/jdk/pull/805
More information about the hotspot-gc-dev
mailing list