linux/Documentation
Breno Leitao e776db8e71 mm: kmemleak: report leaks only after N consecutive unreferenced scans
kmemleak reports an object the first scan it is found unreferenced.  Its
mark phase runs without stopping the rest of the kernel and without a
write barrier, so a live object whose only reference is briefly invisible
during a concurrent RCU update -- e.g.  a VMA moved between maple tree
nodes, or a page-cache xa_node -- can be seen as unreferenced for that one
scan.  Because an object is flagged as reported only once, such a
transient race turns into a permanent false positive.

Track how many consecutive scans each object has been seen unreferenced
and only report it once that reaches min_unref_scans, a new module
parameter.  It defaults to 1, leaving the behaviour unchanged; setting it
higher (e.g.  2) still reports a genuine leak, one scan later, while an
object referenced again before the threshold restarts its run and is never
reported.

min_unref_scans can be set at boot with kmemleak.min_unref_scans=<n> or at
run-time via /sys/module/kmemleak/parameters/min_unref_scans.

Link: https://lore.kernel.org/20260713-catalin_pto-v1-2-5b93b1131089@debian.org
Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: David Hildenbrand <david@kernel.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Liam R. Howlett <liam@infradead.org>
Cc: Lorenzo Stoakes <ljs@kernel.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2026-08-24 18:43:17 -07:00
..
ABI dax/kmem: add sysfs interface for atomic whole-device hotplug 2026-08-06 18:57:00 -07:00
accel
accounting
admin-guide mm/hugetlb_cma: support percentage-based hugetlb_cma reservation 2026-08-24 18:43:11 -07:00
arch RISC-V updates for v7.2-rc3 2026-07-12 11:25:40 -07:00
block for-7.2/block-20260615 2026-06-16 13:02:47 +05:30
bpf Documentation/bpf: Refresh map_lru_hash_update.dot for rqspinlock 2026-06-07 18:46:13 -07:00
cdrom
core-api mm: rename swap.c to folio.c 2026-08-04 19:18:35 -07:00
cpu-freq cpufreq: Use policy->min/max init as QoS request 2026-06-08 18:42:14 +02:00
crypto lib/crypto: docs: Improve introduction sentence 2026-07-09 11:06:05 -04:00
dev-tools mm: kmemleak: report leaks only after N consecutive unreferenced scans 2026-08-24 18:43:17 -07:00
devicetree spi: dt-bindings: spacemit: add K3 SPI compatible 2026-07-21 22:39:30 +01:00
doc-guide
driver-api percpu_ref: fix documentation of maximum value 2026-07-28 21:11:55 -07:00
edac
fault-injection
fb
features LoongArch: Add THREAD_INFO_IN_TASK implementation 2026-06-25 13:03:47 +08:00
filesystems mm/swap: remove SWP_FS_OPS 2026-08-24 18:43:15 -07:00
firmware_class
firmware-guide docs: acpi: dsd: add Motorcomm yt8xxx PHY properties 2026-05-11 18:05:22 -07:00
fpga
gpu drm-next for 7.2-rc1 2026-06-17 10:21:00 +01:00
hid
hwmon docs: hwmon: ltc4283: fix malformed table docs build error 2026-06-29 08:47:44 -07:00
i2c
iio docs: iio: adc: ad4691: add driver documentation 2026-05-31 11:14:22 +01:00
images
infiniband docs: infiniband: correct name of option to enable the ib_uverbs module 2026-06-16 14:47:24 -03:00
input Input: userio - allow setting other id values 2026-06-01 21:49:14 -07:00
kbuild kconfig: add optional warnings for changed input values 2026-06-18 11:46:32 -07:00
kernel-hacking
leds LEDs for v7.2 2026-06-18 14:45:08 -07:00
litmus-tests
livepatch
locking Things have calmed down a bit on the docs front, with no earthshaking 2026-06-16 08:35:59 +05:30
maintainer
mhi
misc-devices
mm alloc_tag: add ioctl to /proc/allocinfo 2026-08-24 18:43:12 -07:00
netlabel
netlink netlink: specs: rt-link: convert bridge port flag attributes to u8 2026-07-20 18:14:42 -07:00
networking vlan: defer real device state propagation to netdev_work 2026-06-25 10:18:40 -07:00
nvdimm
nvme
PCI
pcmcia
peci
power
process MAINTAINERS: update ndesaulniers 2026-07-06 15:49:29 -07:00
RCU
rust s390 updates for 7.2 merge window 2026-06-16 05:08:13 +05:30
scheduler sched_ext: Documentation: Fix ops table header reference 2026-07-07 12:23:33 -10:00
scsi scsi: st: Fix typo in documentation 2026-05-14 21:59:19 -04:00
security integrity-v7.2 2026-06-19 11:32:05 -07:00
sound Documentation: sound: tas675x: Fix temperature range and impedance documentation 2026-07-01 19:52:38 +01:00
sphinx docs: maintainers_include: keep the last entry at the end 2026-05-25 14:24:09 -06:00
sphinx-includes
sphinx-static docs: sphinx-static: fix typo "wich" -> "which" 2026-05-15 07:52:37 -06:00
spi
staging
sunrpc/xdr Documentation: Add the RPC language description of NLM version 3 2026-06-09 16:32:59 -04:00
target
tee
timers
tools A handful of late-arriving docs fixes, along with one document update 2026-06-25 09:09:38 -07:00
trace A handful of late-arriving docs fixes, along with one document update 2026-06-25 09:09:38 -07:00
translations ksm: update comments and docs to reference folio->mapping 2026-08-24 18:43:02 -07:00
usb
userspace-api alloc_tag: add ioctl to /proc/allocinfo 2026-08-24 18:43:12 -07:00
virt s390: 2026-06-25 10:21:13 -07:00
w1
watchdog docs: watchdog: Fix brackets 2026-07-02 07:12:58 -07:00
wmi modpost: Handle malformed WMI GUID strings 2026-06-12 16:01:55 +03:00
.gitignore
.renames.txt Revert "drivers: net: 3com: 3c509: Remove this driver" 2026-05-21 08:28:56 -07:00
atomic_bitops.txt
atomic_t.txt
Changes
CodingStyle
conf.py
docutils.conf
index.rst
Kconfig
Makefile
memory-barriers.txt
SubmittingPatches
subsystem-apis.rst