From: Weilin Tong <tongweilin@linux.alibaba.com>
To: catalin.marinas@arm.com, akpm@linux-foundation.org
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: [PATCH 0/2] mm: kmemleak: avoid long RCU read-side sections in reports
Date: Thu, 5 Nov 2026 17:52:48 +0800 [thread overview]
Message-ID: <cover.1793871596.git.tongweilin@linux.alibaba.com> (raw)
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
next reply other threads:[~2026-11-05 9:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-05 9:52 Weilin Tong [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1793871596.git.tongweilin@linux.alibaba.com \
--to=tongweilin@linux.alibaba.com \
--cc=akpm@linux-foundation.org \
--cc=catalin.marinas@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®