RFR: 8261401: Add sanity check for UseSHM large pages similar to the one used with hugetlb large pages [v2]

Thomas Stuefe stuefe at openjdk.java.net
Thu Feb 11 05:45:40 UTC 2021


On Wed, 10 Feb 2021 19:30:58 GMT, Stefan Johansson <sjohanss at openjdk.org> wrote:

>> src/hotspot/os/linux/os_linux.cpp line 3781:
>> 
>>> 3779:   }
>>> 3780: 
>>> 3781:   log_warning(pagesize)("UseLargePages disabled, no large pages configured and available on the system.");
>> 
>> IIUC here we end up if UseLargePages=true (by default or not) and we were unable to get any of our APIs to work? Should this be an unconditional printout? At least make it only unconditional if UseLargePages==true is not default? I know its only a theoretical problem now since default is false.
>
> You are correct we only end up here if `UseLargePages` is true. Making it conditional like that would be consistent with the other warnings. So only warn if the user explicitly set `+UseLargePages`. So something like?
> Suggestion:
> 
>   if (!FLAG_IS_DEFAULT(UseLargePages)) {
>     log_warning(pagesize)("UseLargePages disabled, no large pages configured and available on the system.");
>   }

Seems reasonable and in line with what we do otherwise.

As a side note, I'm not a big fan of unconditional error printouts for non-fatal errors. Can mess with parsers (see eg JDK-8260902). The argument "we trace only if flag is explicitly set" is valid oc, but even so customers tend to bury flags in scripts and then forget them. But I know this is common procedure so this would be a separate discussion.

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

PR: https://git.openjdk.java.net/jdk/pull/2488


More information about the hotspot-dev mailing list