Skip to contentSkip to conversation

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

PATCH Superseded Suren Baghdasaryan 3 participants 6 messages Jan 15 – Jan 16

Subsystems (6)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Suren Baghdasaryan

author maintainer
#0 lore raw

PATCH 1/1 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).

Fixes ebdf9ad4ca98 ("memprofiling: documentation")
---
 Documentation/admin-guide/sysctl/vm.rst   |  4 ++++
 Documentation/mm/allocation-profiling.rst | 10 ++++++++++
 2 files changed, 14 insertions(+)
Documentation/admin-guide/sysctl/vm.rst +4 -0
index 9096e2d77c2a..8577ea91e226 100644
@@ -487,6 +487,10 @@ memory allocations.
 
 The default value depends on CONFIG_MEM_ALLOC_PROFILING_ENABLED_BY_DEFAULT.
 
+When CONFIG_MEM_ALLOC_PROFILING_DEBUG=y, this control is read-only to avoid
+warnings produces by allocations made while profiling is disabled and freed
+when it's enabled.
+
 
 memory_failure_early_kill
 =========================
Documentation/mm/allocation-profiling.rst +10 -0
index 316311240e6a..058d2faffb75 100644
@@ -33,6 +33,16 @@ Boot parameter:
 sysctl:
   /proc/sys/vm/mem_profiling
 
+  1: Enable memory profiling.
+
+  0: Disable memory profiling.
+
+  The default value depends on CONFIG_MEM_ALLOC_PROFILING_ENABLED_BY_DEFAULT.
+
+  When CONFIG_MEM_ALLOC_PROFILING_DEBUG=y, this control is read-only to avoid
+  warnings produces by allocations made while profiling is disabled and freed
+  when it's enabled.
+
 Runtime info:
   /proc/allocinfo
 

base-commit: 560d6a4c4951ae76b5c6d5b5b8650276706f68ac

Signature · 1 line
2.52.0.457.g6b5491de43-goog
#1 lore raw
Quoted 1 line · Suren Baghdasaryan

+ warnings produces by allocations made while profiling is disabled and freed

"produced"

author maintainer
#2 lore raw
Quoted 5 lines · Matthew Wilcox
Quoted 1 line · Suren Baghdasaryan

+ warnings produces by allocations made while profiling is disabled and freed

"produced"

Thanks! I'll wait for a day and if there are no other objections, I will post a fixed version.

Acked-by
#3 lore raw
Quoted 9 lines · On Thu, 15 Jan 2026 09:05:25 -0800 Suren Baghdasaryan <[email protected]> wrote:
Quoted 5 lines · Matthew Wilcox
Quoted 1 line · Suren Baghdasaryan

+ warnings produces by allocations made while profiling is disabled and freed

"produced"

Thanks! I'll wait for a day and if there are no other objections, I will post a fixed version.

Assuming Matthiew's good finding will be fixed,

Fwiw, the typo is also on the .../sysctl/vm.rst part. And from the finding, I was wondering if it is better to put the description only one of two documents rather than having the duplication, and further if the 'Usage:' part of allocation-profiling.rst is better to be moved to 'Documentation/admin-guide/mm/'. But I ended up thinking those are too trivial and small things.

Thanks,
SJ

author maintainer
#4 lore raw
Quoted 8 lines · SeongJae Park
Quoted 5 lines · On Thu, 15 Jan 2026 09:05:25 -0800 Suren Baghdasaryan <[email protected]> wrote:
Quoted 4 lines · Matthew Wilcox
Quoted 1 line · Suren Baghdasaryan

+ warnings produces by allocations made while profiling is disabled and freed

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

"produced"

Thanks! I'll wait for a day and if there are no other objections, I will post a fixed version.

Assuming Matthiew's good finding will be fixed,

Thanks!

Quoted 2 lines

Fwiw, the typo is also on the .../sysctl/vm.rst part.

Correct, I'll fix in both places.

Quoted 6 lines

And from the finding, I
was wondering if it is better to put the description only one of two documents rather than having the duplication, and further if the 'Usage:' part of allocation-profiling.rst is better to be moved to 'Documentation/admin-guide/mm/'. But I ended up thinking those are too trivial and small things.

Yes, I didn't want to complicate reader's life by adding a reference for a couple of sentences.

Quoted 4 lines

Thanks,
SJ

author maintainer
#5 lore raw
Quoted 17 lines · Suren Baghdasaryan
Quoted 15 lines · SeongJae Park
Quoted 9 lines · On Thu, 15 Jan 2026 09:05:25 -0800 Suren Baghdasaryan <[email protected]> wrote:
Quoted 5 lines · Matthew Wilcox
Quoted 1 line · Suren Baghdasaryan

+ warnings produces by allocations made while profiling is disabled and freed

"produced"

Thanks! I'll wait for a day and if there are no other objections, I will post a fixed version.

Assuming Matthiew's good finding will be fixed,

Quoted 8 lines
Quoted 1 line

Thanks!

Quoted 2 lines

Fwiw, the typo is also on the .../sysctl/vm.rst part.

Correct, I'll fix in both places.

v2 is posted at
https://lore.kernel.org/all/[email protected]/

Quoted 15 lines
Quoted 7 lines

And from the finding, I
was wondering if it is better to put the description only one of two documents rather than having the duplication, and further if the 'Usage:' part of allocation-profiling.rst is better to be moved to 'Documentation/admin-guide/mm/'. But I ended up thinking those are too trivial and small things.

Yes, I didn't want to complicate reader's life by adding a reference for a couple of sentences.

Quoted 4 lines

Thanks,
SJ