RFR: 8324781: runtime/Thread/TestAlwaysPreTouchStacks.java failed with Expected a higher ratio between stack committed and reserved
Liming Liu
duke at openjdk.org
Thu Mar 21 06:20:19 UTC 2024
On Thu, 21 Mar 2024 05:16:56 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> The testcase failed on Oracle CI since JDK-8315923. The root cause is that Oracle CI runs Linux-5.4.17-UEK where the value of MADV_POPULATE_WRITE (23) is used as MADV_DONTEXEC which is not supported by upstream. This PR solves the testcase failure by checking the support of (MADV_POPULATE_WRITE_value + 1) for UEK releases.
>
> src/hotspot/os/linux/os_linux.cpp line 4852:
>
>> 4850: // See https://github.com/oracle/linux-uek/issues/23
>> 4851: const int flag = MADV_POPULATE_WRITE + (os::Linux::_is_uek_release ? 1 : 0);
>> 4852: FLAG_SET_DEFAULT(UseMadvPopulateWrite, (::madvise(0, 0, flag) == 0));
>
> I read the supporting material and I still can't get this sorted in my head. From my reading some UEK versions have this problem and some do not. But you do this "trick" for all UEK versions and I just don't understand how that works. ??
Personally, I think checking 24 for all UEK versions is safe:
- for versions prior to 5.15 UEK, 23 is supported as MADV_DONTEXEC, while 24 is not supported;
- for 5.15 (, 5.16 and 5.17 if existed) UEK, 23 is supported as MADV_POPULATE_WRITE, while 24 is supported as MADV_DOEXEC;
- for 5.18 or newer (with or without UEK), both 23 and 24 are supported.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18417#discussion_r1533298419
More information about the hotspot-runtime-dev
mailing list