On Thu, 4 Sep 2025 14:19:06 GMT, Stefan Johansson <[email protected]> wrote:

> Please review this enhancement to the smaps parser and printer.
> 
> **Summary**
> While working on [JDK-8366434](https://bugs.openjdk.org/browse/JDK-8366434) 
> one idea for a test to verify if the heap CAN be backed by transparent huge 
> pages (THP) was to use PrintMemoryMapAtExit and look at the tags printed for 
> JAVAHEAP.
> 
> It turns out this worked in most cases but on systems where the THP mode is 
> configured as 'always' but there are no huge pages available for use, the 
> JAVAHEAP line will not show any indication that it can be backed by huge 
> pages.
> 
> For this to be possible we need to parse the field THPeligible as well and 
> include this information in the printouts. With this change we now parse the 
> THPeligible field and tag mapping that are THP eligible with `thpel`. We skip 
> this tag for mappings that are tagged with `thpad` (madvised with 
> MADV_HUGEPAGE) to avoid too much THP info on one mapping.
> 
> **Testing**
> * Mach5 testing with the existing test showed a need to update the regex for 
> verifying Metaspace and the fix have been tested manually locally as well as 
> in Mach5.

This pull request has now been integrated.

Changeset: 937e19e8
Author:    Stefan Johansson <[email protected]>
URL:       
https://git.openjdk.org/jdk/commit/937e19e86aab9194c363fb8709bbbc6dead0c391
Stats:     16 lines in 4 files changed: 12 ins; 1 del; 3 mod

8366780: Enhance ProcSmapsParser and Printer to handle THPeligible field

Reviewed-by: stuefe, ayang

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

PR: https://git.openjdk.org/jdk/pull/27098

Reply via email to