Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] alloc_tag: expose profiling and compression states in /proc/allocinfo
@ 2026-07-30 23:48 Abhishek Bapat
  2026-07-31  2:41 ` Hao Ge
  0 siblings, 1 reply; 2+ messages in thread
From: Abhishek Bapat @ 2026-07-30 23:48 UTC (permalink / raw)
  To: Suren Baghdasaryan, Andrew Morton, Hao Ge
  Cc: linux-kernel, linux-mm, Abhishek Bapat

Currently, userspace has limited visibility into the exact active
runtime state of memory allocation profiling and its page extension
compression ('sysctl.vm.mem_profiling={0|1|never}[,compressed]').

While reading the sysctl provides basic on/off status, it is currently
impossible for userspace to natively determine whether page-tag
compression was successfully enabled without scraping dmesg boot logs.

Resolve this ambiguity by exposing the active compression state by
adding a new read-only sysctl `vm.memprofiling_compressed` to output the
state.

Signed-off-by: Abhishek Bapat <abhishekbapat@google.com>
---
 mm/alloc_tag.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/mm/alloc_tag.c b/mm/alloc_tag.c
index 52aece27b00e..877068241f06 100644
--- a/mm/alloc_tag.c
+++ b/mm/alloc_tag.c
@@ -1303,6 +1303,12 @@ static const struct ctl_table memory_allocation_profiling_sysctls[] = {
 		.mode		= 0644,
 		.proc_handler	= proc_mem_profiling_handler,
 	},
+	{
+		.procname	= "mem_profiling_compressed",
+		.data		= &mem_profiling_compressed,
+		.mode		= 0444,
+		.proc_handler	= proc_do_static_key,
+	},
 };
 
 static void __init sysctl_init(void)

base-commit: 2ed26e8a624f41887d64e2e37a2f6ab36a118d1f
-- 
2.55.0.508.g3f0d502094-goog



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-07-31  2:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-30 23:48 [PATCH v2] alloc_tag: expose profiling and compression states in /proc/allocinfo Abhishek Bapat
2026-07-31  2:41 ` Hao Ge

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox