linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Barry Song <21cnbao@gmail.com>
To: akpm@linux-foundation.org, linux-mm@kvack.org
Cc: cerasuolodomenico@gmail.com, chrisl@kernel.org, david@redhat.com,
	kasong@tencent.com, linux-kernel@vger.kernel.org,
	peterx@redhat.com, ryan.roberts@arm.com, surenb@google.com,
	v-songbaohua@oppo.com, willy@infradead.org,
	yosryahmed@google.com, yuzhao@google.com, corbet@lwn.net
Subject: [PATCH v6 0/4] mm: add per-order mTHP alloc and swpout counters
Date: Fri, 12 Apr 2024 23:48:54 +1200	[thread overview]
Message-ID: <20240412114858.407208-1-21cnbao@gmail.com> (raw)

From: Barry Song <v-songbaohua@oppo.com>

The patchset introduces a framework to facilitate mTHP counters, starting
with the allocation and swap-out counters. Currently, only four new nodes
are appended to the stats directory for each mTHP size.

/sys/kernel/mm/transparent_hugepage/hugepages-<size>/stats
	anon_fault_alloc
	anon_fault_fallback
	anon_fault_fallback_charge
	anon_swpout
	anon_swpout_fallback

These nodes are crucial for us to monitor the fragmentation levels of
both the buddy system and the swap partitions. In the future, we may
consider adding additional nodes for further insights.

-v6:
  * collect reviewed-by tags for patch2/4, 3/4, 4/4, Ryan;
  * move back to static array by using MAX_PTRS_PER_PTE, Ryan;
  * move to for_each_possible_cpu to handle cpu hotplug, Ryan;
  * other minor cleanups according to Ryan;
 
-v5:
  * rename anon_alloc to anon_fault_alloc, Barry/Ryan;
  * add anon_fault_fallback_charge, Ryan;
  * move to dynamic alloc_percpu as powerpc's PMD_ORDER is not const,
    kernel test robot;
  * make anon_fault_alloc and anon_fault_fallback more consistent
    with thp_fault_alloc and thp_fault_fallback, Ryan;
  * handle cpu hotplug properly, Ryan;
  * add docs for new sysfs nodes and ABI, Andrew.
  link:
  https://lore.kernel.org/linux-mm/20240412073740.294272-1-21cnbao@gmail.com/

-v4:
  * Many thanks to David and Ryan for your patience and valuable insights
    throughout the numerous renaming efforts!
  * Guard the case order > PMD_ORDER in count func rather than in callers,
    Ryan;
  * Add swpout counters;
  * Add a helper DEFINE_MTHP_STAT_ATTR to avoid code duplication for various
    counters;
  link:
  https://lore.kernel.org/linux-mm/20240405102704.77559-1-21cnbao@gmail.com/

-v3:
  https://lore.kernel.org/linux-mm/20240403035502.71356-1-21cnbao@gmail.com/

Barry Song (4):
  mm: add per-order mTHP anon_fault_alloc and anon_fault_fallback
    counters
  mm: add per-order mTHP anon_swpout and anon_swpout_fallback counters
  mm: add docs for per-order mTHP counters and transhuge_page ABI
  mm: correct the docs for thp_fault_alloc and thp_fault_fallback

 .../sys-kernel-mm-transparent-hugepage        | 17 ++++++
 Documentation/admin-guide/mm/transhuge.rst    | 32 ++++++++++-
 include/linux/huge_mm.h                       | 23 ++++++++
 mm/huge_memory.c                              | 56 +++++++++++++++++++
 mm/memory.c                                   |  5 ++
 mm/page_io.c                                  |  1 +
 mm/vmscan.c                                   |  3 +
 7 files changed, 135 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/ABI/testing/sys-kernel-mm-transparent-hugepage

-- 
2.34.1



             reply	other threads:[~2024-04-12 11:49 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-12 11:48 Barry Song [this message]
2024-04-12 11:48 ` [PATCH v6 1/4] mm: add per-order mTHP anon_fault_alloc and anon_fault_fallback counters Barry Song
2024-04-12 11:59   ` Ryan Roberts
2024-04-12 11:48 ` [PATCH v6 2/4] mm: add per-order mTHP anon_swpout and anon_swpout_fallback counters Barry Song
2024-04-16  8:14   ` David Hildenbrand
2024-04-16  8:16     ` Barry Song
2024-04-16  8:17     ` David Hildenbrand
2024-04-12 11:48 ` [PATCH v6 3/4] mm: add docs for per-order mTHP counters and transhuge_page ABI Barry Song
2024-04-16  8:15   ` David Hildenbrand
2024-04-12 11:48 ` [PATCH v6 4/4] mm: correct the docs for thp_fault_alloc and thp_fault_fallback Barry Song
2024-04-16  8:16   ` David Hildenbrand
2024-04-12 12:54 ` [PATCH v6 0/4] mm: add per-order mTHP alloc and swpout counters David Hildenbrand
2024-04-12 13:16   ` Barry Song
2024-04-16  8:08     ` David Hildenbrand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240412114858.407208-1-21cnbao@gmail.com \
    --to=21cnbao@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=cerasuolodomenico@gmail.com \
    --cc=chrisl@kernel.org \
    --cc=corbet@lwn.net \
    --cc=david@redhat.com \
    --cc=kasong@tencent.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=peterx@redhat.com \
    --cc=ryan.roberts@arm.com \
    --cc=surenb@google.com \
    --cc=v-songbaohua@oppo.com \
    --cc=willy@infradead.org \
    --cc=yosryahmed@google.com \
    --cc=yuzhao@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).