Skip to content

mm: kmemleak: reduce transient false positives by confirming leaks

Breno Leitao linux-doc linux-kselftest linux-mm lkml workflows 1 version Applied

Status from this message: [merged mm-stable] selftests-mm-test-kmemleaks-n-consecutive-scan-leak-confirmation.patch removed from -mm tree

Get series with b4
b4 am [email protected] change-id 20260713-catalin_pto-dbacf66be3fa

Versions newest first

  1. v1 Latest4 patches 4 repliesApplied 4/4

Changes from v1 from the cover letter

Now that commit 79c37ae3733e9 is upstream, the selftest includes an additional priming phase scan as requested by Catalin.

Patches in v1 All 4 applied

#Subject and filesSizeRepliesApplied
1/4mm: kmemleak: confirm suspected leaks with a second scanmm/kmemleak.c+54 -32 repliesApplied
2/4mm: kmemleak: report leaks only after N consecutive unreferenced scansDocumentation/dev-tools/kmemleak.rst mm/kmemleak.c+20 -10 repliesApplied
3/4mm: kmemleak: factor leak confirmation into a helpermm/kmemleak.c+21 -51 replyApplied
4/4selftests: mm: test kmemleak's N-consecutive-scan leak confirmationtools/testing/selftests/mm/Makefile tools/testing/selftests/mm/ksft_kmemleak_confirm.sh+133 -01 replyApplied

Reviews trailers per patch

3 of 4 patches have a Reviewed-by or Acked-by.

PatchCatalin Marinas
1/4
2/4R-b
3/4R-b
4/4R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/4] mm: kmemleak: reduce transient false positives by confirming leaks

This series combines two kmemleak enhancements that were originally submitted separately but both required rebasing after commit 79c37ae3733e9 ("mm/kmemleak:
fix checksum computation for per-cpu objects").

The first feature introduces a second scan to confirm suspected leaks:

        https://lore.kernel.org/all/[email protected]/

The second feature adds a module parameter controlling the minimum number of consecutive unreferenced scans before a leak is reported, as discussed in:

        https://lore.kernel.org/all/[email protected]/

Changes from v1:
Now that commit 79c37ae3733e9 is upstream, the selftest includes an additional priming phase scan as requested by Catalin.

Additionally, I've factored out the leak-detection conditional into a helper function to be more digestible for the reader's eye.

This 4-patch series resolves all outstanding kmemleak issues I've been tracking.

---
Breno Leitao (3):
mm: kmemleak: report leaks only after N consecutive unreferenced scans
mm: kmemleak: factor leak confirmation into a helper
selftests: mm: test kmemleak's N-consecutive-scan leak confirmation

Catalin Marinas (1):
mm: kmemleak: confirm suspected leaks with a second scan

 Documentation/dev-tools/kmemleak.rst               |   8 ++
 mm/kmemleak.c                                      |  90 +++++++++++++-
 tools/testing/selftests/mm/Makefile                |   1 +
 .../testing/selftests/mm/ksft_kmemleak_confirm.sh  | 132 +++++++++++++++++++++
 4 files changed, 225 insertions(+), 6 deletions(-)

---
base-commit: bee763d5f341b99cf472afeb508d4988f62a6ca1
change-id: 20260713-catalin_pto-dbacf66be3fa

Best regards,

Signature · 1 line
Breno Leitao <[email protected]>