RFR: 8311248: Refactor CodeCache::initialize_heaps to simplify adding new CodeCache segments [v2]
Evgeny Astigeevich
eastigeevich at openjdk.org
Thu Jan 18 15:05:15 UTC 2024
On Sat, 6 Jan 2024 14:05:33 GMT, Boris Ulasevich <bulasevich at openjdk.org> wrote:
>> The change simplifies the CodeCache::initialize_heaps segment memory split logic while preserving the existing layout:
>>
>> if (!non_nmethod_set && !profiled_set && !non_profiled_set) {
>> ...
>> } else if (!non_nmethod_set || !profiled_set || !non_profiled_set) {
>> if (non_profiled_set) {
>> if (!profiled_set) {
>> ...
>> }
>> } else if (profiled_set) {
>> ...
>> } else if (non_nmethod_set) {
>> ...
>> }
>> }
>>
>> -->
>>
>> if (!profiled.set && !non_profiled.set) {
>> ..
>> }
>> if (profiled.set && !non_profiled.set) {
>> ..
>> }
>> if (!profiled.set && non_profiled.set) {
>> ..
>> }
>> if (!non_nmethod.set && profiled.set && non_profiled.set) {
>> ..
>> }
>>
>>
>> With this change, PrintFlagsFinal shows the actual segment sizes (not an intermediate value before alignment), and the segments completely fill the ReservedCodeCacheSize (no wasted page due to final down alignment).
>
> Boris Ulasevich has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains one new commit since the last revision:
>
> cleanup & test udpdate
src/hotspot/share/code/codeCache.cpp line 181:
> 179: GrowableArray<CodeHeap*>* CodeCache::_allocable_heaps = new(mtCode) GrowableArray<CodeHeap*> (static_cast<int>(CodeBlobType::All), mtCode);
> 180:
> 181: void CodeCache::report_cache_minimal_size_error(const char *codeheap, size_t size, size_t required_size) {
I suggest to have a function:
static void check_min_size(... code_heap, size_t min_required_size) {
if (code_heap.enabled && code_heap.size >= min_required_size)
return;
log_debug(codecache)("Code heap (%s) size " SIZE_FORMAT " below required minimal size " SIZE_FORMAT,
code_heap.name, code_heap.size, min_required_size);
err_msg title("Not enough space in %s to run VM", code_heap.name);
err_msg message(SIZE_FORMAT "K < " SIZE_FORMAT "K", code_heap.size / K, min_required_size / K);
vm_exit_during_initialization(title, message);
}
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17244#discussion_r1457571407
More information about the hotspot-dev
mailing list