summaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
authorBreno Leitao <leitao@debian.org>2026-09-17 06:47:37 -0700
committerAndrew Morton <akpm@linux-foundation.org>2026-10-12 21:26:25 -0700
commit9596a3ef02fc3f5771f573e142138ef00a867603 (patch)
tree44883d9c2370a7e55dd275aefe33553c530f9a60 /Documentation
parentb523fc8e6bfae8e8bb05c39e259c4ce4a084e439 (diff)
downloadlinux-next-9596a3ef02fc3f5771f573e142138ef00a867603.tar.gz
linux-next-9596a3ef02fc3f5771f573e142138ef00a867603.zip
mm: kmemleak: raise min_unref_scans to 3 for verbose auto-scan
CONFIG_DEBUG_KMEMLEAK_VERBOSE sends every report to the console, so a transient false positive there is broadcast to whatever collects the kernel log rather than sitting in the debugfs file until someone looks. That asymmetry justifies being more conservative than the general case. Require one more consecutive unreferenced scan before reporting. The only cost is that a genuine leak is reported one scan interval later (600s by default); the value stays writable at run time through the module parameter. Kernels without CONFIG_DEBUG_KMEMLEAK_VERBOSE keep reporting on the first unreferenced scan. I've been running constant upstream kernel with CONFIG_DEBUG_KMEMLEAK_VERBOSE set, and I am still seeing some rare false positive, that goes away with min_unref_scans=3, so, making it the default based on my heuristic. Link: https://lore.kernel.org/20260917-b4-kmemleak-doc-v1-3-84fde6d1f749@debian.org Signed-off-by: Breno Leitao <leitao@debian.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Reviewed-by: Catalin Marinas <catalin.marinas@arm.com> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Randy Dunlap <rdunlap@infradead.org>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/dev-tools/kmemleak.rst2
1 files changed, 1 insertions, 1 deletions
diff --git a/Documentation/dev-tools/kmemleak.rst b/Documentation/dev-tools/kmemleak.rst
index b5fe7e671d0f..c0d329372342 100644
--- a/Documentation/dev-tools/kmemleak.rst
+++ b/Documentation/dev-tools/kmemleak.rst
@@ -206,7 +206,7 @@ the minimum age of an object to be reported as a memory leak.
The ``min_unref_scans`` module parameter requires an object to be seen
unreferenced in that many consecutive scans before it is reported. It
-defaults to 2 when CONFIG_DEBUG_KMEMLEAK_VERBOSE is enabled, where the
+defaults to 3 when CONFIG_DEBUG_KMEMLEAK_VERBOSE is enabled, where the
periodic scan thread confirms a leak on its own, and to 1 otherwise. A
value of 1 preserves the historical behaviour; higher values filter the
transient false positives described above, at the cost of delaying genuine