From: Mark Bundschuh <mkbund@amazon.com>
To: <akpm@linux-foundation.org>, <muchun.song@linux.dev>,
<osalvador@suse.de>
Cc: <david@kernel.org>, <linux-mm@kvack.org>,
<linux-kernel@vger.kernel.org>,
Mark Bundschuh <mkbund@amazon.com>
Subject: [PATCH] mm/hugetlb: add htlb_dissolve vmstat event
Date: Thu, 5 Nov 2026 02:03:24 +0000 [thread overview]
Message-ID: <20261105020324.2011790-1-mkbund@amazon.com> (raw)
Memory offline and memory failure handling dissolve free hugetlb folios
and lower nr_hugepages. Nothing records this, so when the pool shrinks
it is hard to tell whether that or a write to nr_hugepages caused it.
Add an htlb_dissolve event, counted for each folio that
dissolve_free_hugetlb_folio() frees.
Signed-off-by: Mark Bundschuh <mkbund@amazon.com>
---
include/linux/vm_event_item.h | 1 +
mm/hugetlb.c | 1 +
mm/vmstat.c | 1 +
3 files changed, 3 insertions(+)
diff --git a/include/linux/vm_event_item.h b/include/linux/vm_event_item.h
index 2628ccda076a..822fe862e5b3 100644
--- a/include/linux/vm_event_item.h
+++ b/include/linux/vm_event_item.h
@@ -71,6 +71,7 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
#endif
#ifdef CONFIG_HUGETLB_PAGE
HTLB_BUDDY_PGALLOC, HTLB_BUDDY_PGALLOC_FAIL,
+ HTLB_DISSOLVE,
#endif
#ifdef CONFIG_CMA
CMA_ALLOC_SUCCESS,
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index da5d04edf7c1..7c79523b2a3c 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -2047,6 +2047,7 @@ int dissolve_free_hugetlb_folio(struct folio *folio)
}
update_and_free_hugetlb_folio(h, folio, false);
+ count_vm_event(HTLB_DISSOLVE);
return rc;
}
out:
diff --git a/mm/vmstat.c b/mm/vmstat.c
index a3e809c57f29..6282eef7074a 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -1397,6 +1397,7 @@ const char * const vmstat_text[] = {
#ifdef CONFIG_HUGETLB_PAGE
[I(HTLB_BUDDY_PGALLOC)] = "htlb_buddy_alloc_success",
[I(HTLB_BUDDY_PGALLOC_FAIL)] = "htlb_buddy_alloc_fail",
+ [I(HTLB_DISSOLVE)] = "htlb_dissolve",
#endif
#ifdef CONFIG_CMA
[I(CMA_ALLOC_SUCCESS)] = "cma_alloc_success",
base-commit: 05441d697f7f9a927264f4058cbbc6a03dfcac9d
--
2.50.1
reply other threads:[~2026-11-05 2:03 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20261105020324.2011790-1-mkbund@amazon.com \
--to=mkbund@amazon.com \
--cc=akpm@linux-foundation.org \
--cc=david@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=muchun.song@linux.dev \
--cc=osalvador@suse.de \
/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
all inboxes | Powered by JetHome®