RFR: 8341334: CDS: Parallel pretouch and relocation [v3]
Aleksey Shipilev
shade at openjdk.org
Wed Oct 2 17:17:21 UTC 2024
On Wed, 2 Oct 2024 16:24:04 GMT, Andrew Dinn <adinn at openjdk.org> wrote:
>> Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Do not create worker threads too early: Mac/Windows are not yet ready to use Semaphores
>
> src/hotspot/share/cds/filemap.cpp line 1959:
>
>> 1957: int chunks_per_bitmap = max_chunks / 2;
>> 1958: if (chunk < chunks_per_bitmap) {
>> 1959: bm = _rw_bm;
>
> How is it guaranteed that the two regions will each have half the chunks?
I admit this is confusing, and likely implicitly relies on max_chunks being divisible by 2. The intent here was to "map" chunks [0..max/2) of one bitmap, and [max/2, max) to another bitmap. The actual "pivot" of max/2 should not have mattered much, since once we get into actual slice computation, we look back to the actual size of the bitmap. I think it could be _significantly more straight-forward_ if we just did "a piece of one bitmap, and a piece of another bitmap" as the unit of work. See new commit?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/21302#discussion_r1784926171
More information about the hotspot-runtime-dev
mailing list