RFR: JDK-8310233: Linux: THP initialization is incorrect
Thomas Stuefe
stuefe at openjdk.org
Mon Jul 3 13:38:55 UTC 2023
On Mon, 3 Jul 2023 10:07:48 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:
>> src/hotspot/os/linux/hugepages.cpp line 160:
>>
>>> 158: LogStream ls(lt);
>>> 159: print_on(&ls);
>>> 160: }
>>
>> As `print_on` prints several lines you want to use `NonInterleavingLogStream`.
>>
>> Do this:
>>
>> ```c++
>> LogMessage(pagesize) lm;
>> NonInterleavingLogStream ls{LogLevelType::Info, lm};
>> if (ls.is_enabled()) {
>> print_on(&ls);
>> }
>
> I'm just using `{}`-init here, it's the same as using `()` so your choice on which to use.
Okay. We are at initialization time, though; everything should still be single-threaded here. I dislike providing the log level twice, but LogTarget does not expose it.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14739#discussion_r1250907436
More information about the hotspot-dev
mailing list