Commit b7e9a1a5 authored by Lance Yang's avatar Lance Yang Committed by Liu Shixin
Browse files

mm: add docs for per-order mTHP split counters

mainline inclusion
from mainline-v6.11-rc1
commit 9b89e018990de47c72ef8b2ca29204f88fda8f05
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/IAIHPC

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9b89e018990de47c72ef8b2ca29204f88fda8f05

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

This commit introduces documentation for mTHP split counters in
transhuge.rst.

[ioworker0@gmail.com: improve the doc as suggested by Ryan]
  Link: https://lkml.kernel.org/r/20240704012905.42971-3-ioworker0@gmail.com
[ioworker0@gmail.com: tweak Documentation/admin-guide/mm/transhuge.rst]
  Link: https://lkml.kernel.org/r/20240707013659.1151-1-ioworker0@gmail.com
Link: https://lkml.kernel.org/r/20240628130750.73097-3-ioworker0@gmail.com


Signed-off-by: default avatarMingzhe Yang <mingzhe.yang@ly.com>
Signed-off-by: default avatarLance Yang <ioworker0@gmail.com>
Reviewed-by: default avatarBarry Song <baohua@kernel.org>
Reviewed-by: default avatarRyan Roberts <ryan.roberts@arm.com>
Acked-by: default avatarDavid Hildenbrand <david@redhat.com>
Cc: Bang Li <libang.li@antgroup.com>
Cc: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: Yang Shi <shy828301@gmail.com>
Cc: Zi Yan <ziy@nvidia.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLiu Shixin <liushixin2@huawei.com>
parent 7e9c56da
Loading
Loading
Loading
Loading
+15 −4
Original line number Diff line number Diff line
@@ -397,10 +397,6 @@ also applies to the regions registered in khugepaged.
Monitoring usage
================

.. note::
   Currently the below counters only record events relating to
   PMD-sized THP. Events relating to other THP sizes are not included.

The number of PMD-sized anonymous transparent huge pages currently used by the
system is available by reading the AnonHugePages field in ``/proc/meminfo``.
To identify what applications are using PMD-sized anonymous transparent huge
@@ -542,6 +538,21 @@ file_fallback_charge
	falls back to using small pages even though the allocation was
	successful.

split
	is incremented every time a huge page is successfully split into
	smaller orders. This can happen for a variety of reasons but a
	common reason is that a huge page is old and is being reclaimed.

split_failed
	is incremented if kernel fails to split huge
	page. This can happen if the page was pinned by somebody.

split_deferred
        is incremented when a huge page is put onto split queue.
        This happens when a huge page is partially unmapped and splitting
        it would free up some memory. Pages on split queue are going to
        be split under memory pressure, if splitting is possible.

As the system ages, allocating huge pages may be expensive as the
system uses memory compaction to copy data around memory to free a
huge page for use. There are some counters in ``/proc/vmstat`` to help