mirror of
https://github.com/torvalds/linux.git
synced 2026-09-12 20:53:03 +02:00
alloc_tag: expose boot-time compression configuration
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.
Add a new read-only sysctl representing how compression was configured
at boot time.
Link: https://lore.kernel.org/c795f8089f82841e8a6e00d7ca286da2b23aeb7b.1785950530.git.abhishekbapat@google.com
Signed-off-by: Abhishek Bapat <abhishekbapat@google.com>
Acked-by: Suren Baghdasaryan <surenb@google.com>
Cc: Hao Ge <hao.ge@linux.dev>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
parent
bb3e3c5c2d
commit
afff109c2f
|
|
@ -43,6 +43,17 @@ sysctl:
|
|||
warnings produced by allocations made while profiling is disabled and freed
|
||||
when it's enabled.
|
||||
|
||||
/proc/sys/vm/mem_profiling_compressed
|
||||
|
||||
1: Page alloc tag compression is enabled.
|
||||
|
||||
0: Page alloc tag compression is disabled.
|
||||
|
||||
This reflects a static boot-time configuration of how page allocation tags are
|
||||
stored (in page flags when compression is enabled and in page_ext when disabled).
|
||||
Toggling ``mem_profiling`` at runtime does not change the state of
|
||||
``mem_profiling_compressed``.
|
||||
|
||||
Runtime info:
|
||||
/proc/allocinfo
|
||||
|
||||
|
|
|
|||
|
|
@ -961,6 +961,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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user