RFR: 8315923: pretouch_memory by atomic-add-0 fragments huge pages unexpectedly [v21]

Liming Liu duke at openjdk.org
Fri Jan 12 09:19:27 UTC 2024


On Thu, 11 Jan 2024 08:17:55 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> Liming Liu has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Use pthread instead
>
> test/hotspot/jtreg/runtime/os/TestTransparentHugePageUsage.java line 46:
> 
>> 44: import java.util.regex.Matcher;
>> 45: import java.util.regex.Pattern;
>> 46: import jdk.test.lib.process.ProcessTools;
> 
> Please add a comment describing what the test does. E.g. "Tests checks that a pretouched java heap appears to use THPs by checking AnonHugePages in smaps". Feel free to find a better formulation.
> 
> Does the test fail without madvise, at least sporadically?
> 
> So I wonder whether it would be better to run with SerialGC, to limit the pretouching to one thread. That would increase the time window needed for pretouching and give us a higher chance to observe those small pages that appear before khugepaged gets around merging them into THPs.

It almost certainly fails with 512MB huge pages and without madvise when vm_page_size is 64KB, but does not likely fail with 2MB huge pages. I would change the check of usage from 0 to 524288 (512MB in KB), and then it would fail with 2MB huge pages.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15781#discussion_r1450105546


More information about the hotspot-dev mailing list