Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Docs/mm/allocation-profiling: describe sysctrl limitations in debug mode

When CONFIG_MEM_ALLOC_PROFILING_DEBUG=y, /proc/sys/vm/mem_profiling is
read-only to avoid debug warnings in a scenario when an allocation is
made while profiling is disabled (allocation does not get an allocation
tag), then profiling gets enabled and allocation gets freed (warning due
to the allocation missing allocation tag).

Link: https://lkml.kernel.org/r/20260116184423.2708363-1-surenb@google.com
Fixes: ebdf9ad4ca98 ("memprofiling: documentation")
Reported-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Acked-by: SeongJae Park <sj@kernel.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Kent Overstreet <kent.overstreet@linux.dev>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Ran Xiaokai <ran.xiaokai@zte.com.cn>
Cc: SeongJae Park <sj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Suren Baghdasaryan and committed by
Andrew Morton
cb7d761b 35e24703

+14
+4
Documentation/admin-guide/sysctl/vm.rst
··· 494 494 495 495 The default value depends on CONFIG_MEM_ALLOC_PROFILING_ENABLED_BY_DEFAULT. 496 496 497 + When CONFIG_MEM_ALLOC_PROFILING_DEBUG=y, this control is read-only to avoid 498 + warnings produced by allocations made while profiling is disabled and freed 499 + when it's enabled. 500 + 497 501 498 502 memory_failure_early_kill 499 503 =========================
+10
Documentation/mm/allocation-profiling.rst
··· 33 33 sysctl: 34 34 /proc/sys/vm/mem_profiling 35 35 36 + 1: Enable memory profiling. 37 + 38 + 0: Disable memory profiling. 39 + 40 + The default value depends on CONFIG_MEM_ALLOC_PROFILING_ENABLED_BY_DEFAULT. 41 + 42 + When CONFIG_MEM_ALLOC_PROFILING_DEBUG=y, this control is read-only to avoid 43 + warnings produced by allocations made while profiling is disabled and freed 44 + when it's enabled. 45 + 36 46 Runtime info: 37 47 /proc/allocinfo 38 48