Skip to content

Commit cb7d761

Browse files
surenbaghdasaryanakpm00
authored andcommitted
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: ebdf9ad ("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>
1 parent 35e2470 commit cb7d761

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

Documentation/admin-guide/sysctl/vm.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,10 @@ memory allocations.
494494

495495
The default value depends on CONFIG_MEM_ALLOC_PROFILING_ENABLED_BY_DEFAULT.
496496

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+
497501

498502
memory_failure_early_kill
499503
=========================

Documentation/mm/allocation-profiling.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,16 @@ Boot parameter:
3333
sysctl:
3434
/proc/sys/vm/mem_profiling
3535

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+
3646
Runtime info:
3747
/proc/allocinfo
3848

0 commit comments

Comments
 (0)