Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] mm: kmemleak: avoid long RCU read-side sections in reports
@ 2026-11-05  9:52 Weilin Tong
  2026-11-05  9:52 ` [PATCH 1/2] mm: kmemleak: serialize disable-time cleanup Weilin Tong
  2026-11-05  9:52 ` [PATCH 2/2] mm: kmemleak: reschedule while reading reports Weilin Tong
  0 siblings, 2 replies; 3+ messages in thread
From: Weilin Tong @ 2026-11-05  9:52 UTC (permalink / raw)
  To: catalin.marinas, akpm; +Cc: linux-mm, linux-kernel

Reading a kmemleak report can traverse all tracked objects in one
RCU read-side section and cause a stall.

Serialize disable-time cleanup with clear operations and report readers,
then use kmemleak_cond_resched() in both report traversal loops to let RCU
progress safely during long reads.

QEMU/KVM tests on mm-stable 6628e7d4c6b25:
* With 134 million real allocations and no injected delay, continuous
  RCU sections fell from 23.11-23.38 s to 126-972 us. Total reading took
  23.11-23.38 s before and 23.67-24.09 s after. Neither kernel stalled.
* With identical 300 us per-node delays, only kernels without patch 2
  stalled. Patch 1 eliminated overlapping cleanup entry.
* Under lazy/full preemption, 560 concurrent-removal cases, 20 deleted-chain
  cases and debugfs read checks passed with KASAN, lockdep and DEBUG_LIST.

Weilin Tong (2):
  mm: kmemleak: serialize disable-time cleanup
  mm: kmemleak: reschedule while reading reports

 mm/kmemleak.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)


base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-05  9:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-05  9:52 [PATCH 0/2] mm: kmemleak: avoid long RCU read-side sections in reports Weilin Tong
2026-11-05  9:52 ` [PATCH 1/2] mm: kmemleak: serialize disable-time cleanup Weilin Tong
2026-11-05  9:52 ` [PATCH 2/2] mm: kmemleak: reschedule while reading reports Weilin Tong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox