RFR: JDK-8310388: Shenandoah: Auxiliary bitmap is not madvised for THP [v2]

Thomas Stuefe stuefe at openjdk.org
Fri Aug 4 16:07:33 UTC 2023


On Thu, 20 Jul 2023 16:39:47 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> 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.
>
> Thomas Stuefe has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Alekseys feedback

Friendly ping... still need a second review.

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

PR Comment: https://git.openjdk.org/jdk/pull/14953#issuecomment-1665854118


More information about the shenandoah-dev mailing list