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

Thomas Stuefe stuefe at openjdk.org
Fri Oct 20 10:35:40 UTC 2023


On Mon, 9 Oct 2023 07:23:38 GMT, Liming Liu <duke at openjdk.org> wrote:

> > Side note, does anyone know why we pretouch memory for _explicit_ large pages? I would have thought that memory is already online and as "live" as it can get once it is mmapped.
> 
> `UseTransparentHugePages` just gives kernel advice to use transparent huge pages. It is not regular huge pages that need to be allocated explicitly through /sys/kernel/mm/hugepages.

Yes, I know, but my question was why we bother to pretouch at all if we run with explicit large pages, so with +UseHugePages. Nothing to do with THP. 

Because explicit large pages are allocated right at reservation from the huge page pool, and the huge page pool looks like it already counts toward dirty pages, whether or not someone allocated from it. Therefore I wonder whether they are already paged in.

Would be a question for @kstefanj maybe. I wonder if we could just omit pretouching in that case.

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

PR Comment: https://git.openjdk.org/jdk/pull/15781#issuecomment-1772492494


More information about the hotspot-runtime-dev mailing list