RFR: 8311248: Refactor CodeCache::initialize_heaps to simplify adding new CodeCache segments [v7]

Boris Ulasevich bulasevich at openjdk.org
Tue Feb 20 12:57:56 UTC 2024


On Mon, 19 Feb 2024 20:32:41 GMT, Evgeny Astigeevich <eastigeevich at openjdk.org> wrote:

>> Boris Ulasevich has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   minor update. removed helper function as it caused many comments in the review
>
> src/hotspot/share/code/codeCache.cpp line 312:
> 
>> 310:   // last adjustment: leftovers from page alignment go to non_nmethod segment
>> 311:   non_nmethod.size += non_profiled.size & alignment_mask(min_size);
>> 312:   non_nmethod.size += profiled.size & alignment_mask(min_size);
> 
> Why do we need this code?

Let us assume that with the previous calculations we have this layout:
- {cache_size=18004KB, non_profiled.size = 6002KB, profiled.size = 6002KB, non_nmethod.size=6000KB}

With next align_down for profiled and non_profiled segments, we get:
- {cache_size=18004KB, non_profiled.size = 6000KB, profiled.size = 6000KB, non_nmethod.size=6000KB}

My intention here is to put 4KB into the non_nmethod segment to make the sum of the segment sizes equal to cache_size:
- {cache_size=18004KB, non_profiled.size = 6000KB, profiled.size = 6000KB, non_nmethod.size=6004KB}

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17244#discussion_r1495775846


More information about the hotspot-dev mailing list