RFR: JDK-8310388: Shenandoah: Auxiliary bitmap is not madvised for THP
Thomas Stuefe
stuefe at openjdk.org
Thu Jul 20 15:24:57 UTC 2023
See details in JBS isse.
Note that there is no actual functional difference. AUX bitmap did not use THPs before this patch and does not now either. The only difference is that before, the JVM *thought* the AUX bitmap uses THPs when in fact it did not. That caused confusion.
(All this illuminates how badly thought out the ReservedSpace API really is. We pass in page size to the constructor, but then need to commit manually; THPs actually use madvise on commit, not on reservation, so we need to pass page size in *again* to commit. Ideally, ReservedSpace should handle committing for us with the page size it saved from reservation.)
Note that this only takes care of preventing THP formation in "madvise" mode. In "always" mode, the kernel will do THP coalescation always. We could prevent it from doing so by advising against it via madvise, but that would require extension of the platform generic reservation APIs and is left for a different RFE. Ideally, nobody should use THP "always" mode.
-------------
Commit messages:
- JDK-8310388-Shenandoah-Auxiliary-bitmap-is-not-madvised-for-THP
Changes: https://git.openjdk.org/jdk/pull/14953/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=14953&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8310388
Stats: 6 lines in 1 file changed: 4 ins; 0 del; 2 mod
Patch: https://git.openjdk.org/jdk/pull/14953.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/14953/head:pull/14953
PR: https://git.openjdk.org/jdk/pull/14953
More information about the shenandoah-dev
mailing list