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

Evgeny Astigeevich eastigeevich at openjdk.org
Thu Feb 15 22:32:57 UTC 2024


On Fri, 2 Feb 2024 09:33:31 GMT, Boris Ulasevich <bulasevich at openjdk.org> wrote:

>> These changes clean up the logic and the code of allocating codecache segments and add more testing of it, to open a door for further optimization of code cache segmentation.  The goal was to keep the behavior as close to the existing behavior as possible, even if it's not quite logical.
>> 
>> Also, these changes better account for alignment - PrintFlagsFinal shows the final aligned segment sizes, and the segments fill the ReservedCodeCacheSize without gaps caused by alignment.
>
> Boris Ulasevich has updated the pull request incrementally with one additional commit since the last revision:
> 
>   set_size_of_unset_code_heap

src/hotspot/share/code/codeCache.cpp line 200:

> 198: };
> 199: 
> 200: static void report_cache_size_error(const CodeHeapInfo& non_nmethod, const CodeHeapInfo& profiled,

Add the comment:
// Exit with reporting an error that the sum of code heap sizes is not equal ReservedCodeCacheSize.

src/hotspot/share/code/codeCache.cpp line 201:

> 199: 
> 200: static void report_cache_size_error(const CodeHeapInfo& non_nmethod, const CodeHeapInfo& profiled,
> 201:                                     const CodeHeapInfo& non_profiled, size_t cache_size) {

You don't need `cache_size` as you assume it holds `ReservedCodeCacheSize`.

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

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


More information about the hotspot-dev mailing list