RFR: 8255235: ZGC: Allocate and initialize forwarding data structures in parallel [v2]

Per Liden pliden at openjdk.java.net
Tue Oct 27 10:41:29 UTC 2020


On Tue, 27 Oct 2020 09:07:40 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

>> Per Liden has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - Merge
>>  - Assert that allocations never fail
>
> 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?

Will fix.

> 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())`.

Sounds like a good idea. I'll add that to #804.

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

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



More information about the hotspot-gc-dev mailing list