Barry Song <21cnbao@xxxxxxxxx> writes: > From: Barry Song <v-songbaohua@xxxxxxxx> > > This helps profile the sizes of folios being swapped in. Currently, > only mTHP swap-out is being counted. > The new interface can be found at: > /sys/kernel/mm/transparent_hugepage/hugepages-<size>/stats/swpin > For example, > $ cat /sys/kernel/mm/transparent_hugepage/hugepages-64kB/stats/swpin > 12809 > $ cat /sys/kernel/mm/transparent_hugepage/hugepages-32kB/stats/swpin > 4763 > > Signed-off-by: Barry Song <v-songbaohua@xxxxxxxx> > Reviewed-by: Baolin Wang <baolin.wang@xxxxxxxxxxxxxxxxx> > Acked-by: David Hildenbrand <david@xxxxxxxxxx> > Cc: Chris Li <chrisl@xxxxxxxxxx> > Cc: Yosry Ahmed <yosryahmed@xxxxxxxxxx> > Cc: "Huang, Ying" <ying.huang@xxxxxxxxx> > Cc: Kairui Song <kasong@xxxxxxxxxxx> > Cc: Ryan Roberts <ryan.roberts@xxxxxxx> > Cc: Kanchana P Sridhar <kanchana.p.sridhar@xxxxxxxxx> > Cc: Usama Arif <usamaarif642@xxxxxxxxx> > --- > -v3: minor refine changelog per Huang, Ying. thanks! > > Documentation/admin-guide/mm/transhuge.rst | 4 ++++ > include/linux/huge_mm.h | 1 + > mm/huge_memory.c | 3 +++ > mm/page_io.c | 3 +++ > 4 files changed, 11 insertions(+) > > diff --git a/Documentation/admin-guide/mm/transhuge.rst b/Documentation/admin-guide/mm/transhuge.rst > index 2a171ed5206e..5caa3fb2feb1 100644 > --- a/Documentation/admin-guide/mm/transhuge.rst > +++ b/Documentation/admin-guide/mm/transhuge.rst > @@ -534,6 +534,10 @@ zswpout > is incremented every time a huge page is swapped out to zswap in one > piece without splitting. > > +swpin > + is incremented every time a huge page is swapped in from a non-zswap > + swap device in one piece. > + > swpout > is incremented every time a huge page is swapped out to a non-zswap > swap device in one piece without splitting. In Documentation/ABI/testing/sysfs-kernel-mm-transparent-hugepage, I found " What: /sys/kernel/mm/transparent_hugepage/ Date: April 2024 Contact: Linux memory management mailing list <linux-mm@xxxxxxxxx> Description: /sys/kernel/mm/transparent_hugepage/ contains a number of files and subdirectories, - defrag - enabled - hpage_pmd_size - khugepaged - shmem_enabled - use_zero_page - subdirectories of the form hugepages-<size>kB, where <size> is the page size of the hugepages supported by the kernel/CPU combination. See Documentation/admin-guide/mm/transhuge.rst for details. " So, Documentation/admin-guide/mm/transhuge.rst will be used as ABI document? [snip] -- Best Regards, Huang, Ying