RFR: JDK-8304954: SegmentedCodeCache fails when using large pages [v4]

Damon Fenacci dfenacci at openjdk.org
Mon Jul 24 13:33:44 UTC 2023


On Mon, 24 Jul 2023 12:29:04 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> Damon Fenacci has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   JDK-8304954: merge ifs checking when to print warning
>
> src/hotspot/share/code/codeCache.cpp line 324:
> 
>> 322:       log_warning(codecache)("%s", msg);
>> 323:       warning("%s", msg);
>> 324:   }
> 
> This "warn if page size is not as expected" topic is more complex.
> 
> For a start, the text is misleading. You don't reserve anything here. "reserve" has a very clear meaning. Here, you only calculated a page size that fits CodeCacheSize geometry, and then found it is smaller than what the user probably wanted, and you want to warn the user about this. Makes sense.
> 
> We also have the following cases:
> 
> - code cache could, in theory, be satisfied with large pages, but its size is not aligned with large page size. E.g. 2MB pages and CodeCacheSize=101m, would result in code cache using 4KB pages.
> - The user may not have LPSIB specified, so it's 0, but he specified +UseLargePages. Then, he may not have a specific page size in mind but may still want to know if the page size of the code cache is not a large page. 
> 
> I think if you warn here when we divert from planned page size for geometry reasons, you should warn for these cases too. An acceptable minimum would be "ps < os::default_large_page_size()"

Right, thanks!

There is just this point that it is not completely clear to me:
> * code cache could, in theory, be satisfied with large pages, but its size is not aligned with large page size. E.g. 2MB pages and CodeCacheSize=101m, would result in code cache using 4KB pages.

Do you mean that with such a configuration (2MB pages and CodeCacheSize=101m) would the code cache use 4KB pages anyway later on? Wouldn't `CodeCache::page_size` return 2MB pages (and possibly align the code cache to 102MB)? (I guess I'm missing something here)

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14903#discussion_r1272268249


More information about the hotspot-compiler-dev mailing list