RFR: 8341334: CDS: Parallel pretouch and relocation [v3]
Andrew Dinn
adinn at openjdk.org
Thu Oct 3 09:10:41 UTC 2024
On Wed, 2 Oct 2024 17:14:26 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
>> 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?
Yes, this is definitely simpler and clearer.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/21302#discussion_r1785887201
More information about the hotspot-runtime-dev
mailing list