RFR: 8324776: runtime/os/TestTransparentHugePageUsage.java fails with The usage of THP is not enough
Thomas Stuefe
stuefe at openjdk.org
Sat Apr 27 05:59:08 UTC 2024
On Tue, 16 Apr 2024 08:57:48 GMT, Liming Liu <duke at openjdk.org> wrote:
> This PR remove the testcase introduced in JDK-8315923, as we could not find a reliable way to evaluate the usage of THP. We have tried the following methods:
>
> 1. transverse /proc/self/smaps rather than looking up the first map covered by the heap, as we found there can be multiple sections in /proc/self/smaps for the heap; (https://github.com/limingliu-ampere/jdk/commit/c5b0c4cdf9fa42988faa9fee6ee004ebb599d40a)
> 2. take the mode of de-fragment and the enabling of khugepaged into account rather than just THP mode, as THP may not be available immediately when the de-fragment mode is neither "always" nor "madvise", or khugepaged does not collapse pages; (https://github.com/limingliu-ampere/jdk/commit/9c70e9384325b44e074a9e8973846343b27fd2cc)
> 3. call madvise with MADV_HUGEPAGE unconditionally rather than calling it only when THP mode is not "always", and adjust the sizes of young and old generations to ensure the parameters are aligned with THP; (https://github.com/limingliu-ampere/jdk/commit/de9607ff64cc526bca9968b72a7065888c2f944d)
> 4. check the changes of system-wide counters like thp_* in /proc/vmstat before and after pretouch via gtest. (https://github.com/limingliu-ampere/jdk/commit/bc83e19a682156ee7d09bf939c2b18f3d8c79e22)
>
> But none of them helps. The amount of THP keeps zero on Oracle CI, although the THP mode is "always", the de-fragment mode is "madvise" and khugepaged is enabled. Furthermore, none of thp counters changed around pretouch. However, we tried the same kernel (5.15-UEK) as Oracle CI on our machine, and found that these methods do help. Thus, we decided to remove this testcase.
I am fine with removing the test case. There is a point of diminishing returns, and you did your due diligence here.
-------------
Marked as reviewed by stuefe (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/18792#pullrequestreview-2026357511
More information about the hotspot-gc-dev
mailing list