RFR: 8335865: Shenandoah: Improve THP pretouch after JDK-8315923

Aleksey Shipilev shade at openjdk.org
Wed Aug 7 17:07:35 UTC 2024


On Fri, 19 Jul 2024 14:28:24 GMT, Neethu Prasad <nprasad at openjdk.org> wrote:

> **Notes**
> os::pretouch is now using madvice now when available and has a fall back to using vm page size [JDK-8315923](https://bugs.openjdk.org/browse/JDK-8315923)
> Hence removing code that sets _pretouch_heap_page_size & _pretouch_bitmap_page_size  in Shenandoah.
> 
> **Testing**
> 
> * Ran test in Linux 5.10 and Linux 6.x and confirmed that there is no regression. I could not replicate the issue or performance improvement though. [add results]
> * Ran [TestTransparentHugePageUsage](https://github.com/openjdk/jdk/commit/a65a89522d2f24b1767e1c74f6689a22ea32ca6a) for Shenandoah and verified that test passed
> * Ran tier 1, tier 2 , tier1_gc_shenandoah, tier2_gc_shenandoah, tier3_gc_shenandoah and hotspot_gc_shenandoah.

I am approving, since the "problem" appears to be a kernel version between 5.8 and 5.14. So THP is broken there, and MADV_POPULATE_WRITE is still not available. Reading the JDK-8315923 code, it essentially does what this code was doing, so we do not actually regress anything.

I think we only need to confirm using the one-liner I had above that >=5.14 really works, and <5.8 does not regress the speed with which we wire up `AnonHugePages`.

src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp line 287:

> 285:   // Reserve aux bitmap for use in object_iterate(). We don't commit it here.
> 286:   size_t aux_bitmap_page_size = bitmap_page_size;
> 287: 

I think this newline is unnecessary.

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

Marked as reviewed by shade (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/20254#pullrequestreview-2225728082
PR Review Comment: https://git.openjdk.org/jdk/pull/20254#discussion_r1707457414


More information about the hotspot-gc-dev mailing list