RFR: 8324781: runtime/Thread/TestAlwaysPreTouchStacks.java failed with Expected a higher ratio between stack committed and reserved [v6]

Liming Liu duke at openjdk.org
Tue Apr 16 09:51:02 UTC 2024


On Tue, 16 Apr 2024 09:24:05 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Liming Liu has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Use kernel_version
>
> src/hotspot/os/linux/os_linux.cpp line 4836:
> 
>> 4834:     bool supportMadvPopulateWrite =
>> 4835:       ((major > 5 || (major == 5 && minor >= 14)) &&
>> 4836:        (::madvise(0, 0, MADV_POPULATE_WRITE) == 0));
> 
> Shouldn't this be checking ` MADV_POPULATE_WRITE_value `?
> 
> I still can't get my head around the possible compile time values versus the potential runtime interpretation of the ` MADV_POPULATE_WRITE`  value.

For example, Linux 5.4-UEK does not support populating pages, and `MADV_POPULATE_WRITE` is not defined there. However, the kernel internally interprets 23 as `MADV_DONEXEC`, while 23 is a value used by upstream kernels as `MADV_POPULATE_WRITE`. `MADV_POPULATE_WRITE_value` is used by hotspot internally, and used for compiling JDK properly when `MADV_POPULATE_WRITE` is not defined. `MADV_POPULATE_WRITE_value` was suggested there: https://github.com/openjdk/jdk/pull/15781#discussion_r1345784162

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18592#discussion_r1567071997


More information about the hotspot-runtime-dev mailing list