Thread (79 messages) 79 messages, 8 authors, 2025-09-15

Re: [PATCH v11 09/15] khugepaged: add per-order mTHP collapse failure statistics

From: Baolin Wang <baolin.wang@linux.alibaba.com>
Date: 2025-09-12 09:40:57
Also in: linux-doc, linux-mm, lkml


On 2025/9/12 11:28, Nico Pache wrote:
Add three new mTHP statistics to track collapse failures for different
orders when encountering swap PTEs, excessive none PTEs, and shared PTEs:

- collapse_exceed_swap_pte: Increment when mTHP collapse fails due to swap
	PTEs

- collapse_exceed_none_pte: Counts when mTHP collapse fails due to
   	exceeding the none PTE threshold for the given order

- collapse_exceed_shared_pte: Counts when mTHP collapse fails due to shared
   	PTEs

These statistics complement the existing THP_SCAN_EXCEED_* events by
providing per-order granularity for mTHP collapse attempts. The stats are
exposed via sysfs under
`/sys/kernel/mm/transparent_hugepage/hugepages-*/stats/` for each
supported hugepage size.

As we currently dont support collapsing mTHPs that contain a swap or
shared entry, those statistics keep track of how often we are
encountering failed mTHP collapses due to these restrictions.

Signed-off-by: Nico Pache <npache@redhat.com>
---
LGTM.
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help