RFR: JDK-8312182: THPs cause huge RSS due to thread start timing issue [v2]
David Holmes
dholmes at openjdk.org
Thu Jul 20 07:07:46 UTC 2023
On Thu, 20 Jul 2023 06:52:01 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
>> src/hotspot/os/linux/globals_linux.hpp line 94:
>>
>>> 92: product(bool, PreventTHPsForThreadStacks, true, EXPERIMENTAL, \
>>> 93: "If true, the JVM will attempt to prevent formation of " \
>>> 94: "transparent huge pages in thread stacks.") \
>>
>> Can we expand this to state that it can be turned off by ergonomics. Or better yet perhaps this should be off by default and potentially turned on by ergonomics?
>
> As in, if THP=always, this will be turned on unless explicitly turned off? I would dislike that I cannot see the default value in globals.hpp (for numerical args, "0" is always an indication for "no value", but for bool, it looks like the real default value).
>
> What do you think about "AllowTHPInThreadStacks" - default off, can be switched on manually to disable the mitigation if someone really wants THP for his thread stacks?
>
> Alternative name "DisableTHPThreadStackMitigation" or somesuch, but I don't like the negation in the name.
The value in globals.hpp cannot tell you what the "default" is because ergonomics may change it no matter which way we decide to express this. For a user that knows nothing about THP mode (e.g. me!) I can't tell whether this will be on or off or whether I may need to turn it off or on.
If the intent is that we normally enable the mitigation when THP mode = always, but the user can turn it off then something like `DisableTHPThreadStackMitigation` seems more appropriate to me.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14919#discussion_r1269021875
More information about the hotspot-runtime-dev
mailing list