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

Boris Ulasevich bulasevich at openjdk.org
Thu Mar 7 11:25:57 UTC 2024


On Mon, 19 Feb 2024 20:38:22 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 316:
> 
>> 314:   // Note: if large page support is enabled, min_size is at least the large
>> 315:   // page size. This ensures that the code cache is covered by large pages.
>> 316:   non_nmethod.size = align_up(non_nmethod.size, min_size);
> 
> A potential problem here: code heap sizes are `min_size` aligned but `cache_size` might be not.

I added an alignment. thanks

> src/hotspot/share/code/codeCache.cpp line 336:
> 
>> 334:     // Tier 2 and tier 3 (profiled) methods
>> 335:     add_heap(profiled_space, "CodeHeap 'profiled nmethods'", CodeBlobType::MethodProfiled);
>> 336:   }
> 
> A redundant check: the non-profiled code heap is always enabled.

Redundant check makes no harm. More questions would be raised without the check. Let me leave the check (this and one below) and provide a comment.

  if (profiled.enabled) {
    check_min_size("profiled code heap", profiled.size, min_size);
  }
  if (non_profiled.enabled) { // non_profiled.enabled is always ON for segmented code heap, leave it checked for clarity
    check_min_size("non-profiled code heap", non_profiled.size, min_size);
  }
  if (cache_size_set) {
    check_min_size("reserved code cache", cache_size, min_cache_size);
  }

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

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


More information about the hotspot-dev mailing list