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

Thomas Stuefe stuefe at openjdk.org
Mon Jul 24 13:56:43 UTC 2023


On Mon, 24 Jul 2023 13:30:39 GMT, Damon Fenacci <dfenacci at openjdk.org> wrote:

>> 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)

I may be wrong too. Looking closer, I think it aligns up. So, I think you can forget the first of the two points. Sorry for the confusion.

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

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


More information about the hotspot-compiler-dev mailing list