RFR: JDK-8312620: WSL Linux build crashes after JDK-8310233

Thomas Stuefe stuefe at openjdk.org
Wed Jul 26 06:39:39 UTC 2023


On Tue, 25 Jul 2023 06:18:08 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

> WSL exposes inconsistent information about hugepage support from proc fs, which makes the JVM assert. This patch makes the JVM instead avoid using hugepages for what is technically broken kernel behavior.
> 
> Testing: manually tested on a kernel where I faked the error we see on WSL.

Thanks for looking at this.

> Would it be simpler to just set the `default_static_huge_pagesize` to zero in this case and effectively disable things that way?

I wanted a clear separation of layers. `HugePages` should be the interface to the machine settings, but not impose any decisions. So, for a broken kernel it should also expose the brokenness. The JVM then decides what to do with it in upper layers (os::large_page_init()). 

This may sound artificial, but the Linux LP coding was long riddled with cross-layer-shortcuts and the JVM overruling the machine settings, such that it had been difficult to exactly see what's going on at a customer.

Besides making the coding clearer separated, it allows us to use `HugePages::print_on` to get an accurate reflection of the machine settings, usable for diagnostics, see also https://github.com/openjdk/jdk/pull/14958 . I plan to slowly extend `HugePages` to expose other settings as well, e.g. the number of configured pages per hugepage pool; that can then replace some of the still existing sanity tests and for diagnostic printing.

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

PR Comment: https://git.openjdk.org/jdk/pull/15007#issuecomment-1651066809


More information about the hotspot-runtime-dev mailing list