From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org,vincenzo.frascino@arm.com,ryabinin.a.a@gmail.com,glider@google.com,dvyukov@google.com,andreyknvl@gmail.com,akpm@linux-foundation.org,sh_def@163.com,akpm@linux-foundation.org
Subject: + kasan-avoid-unnecessary-quarantine-lock-cycling.patch added to mm-new branch
Date: Mon, 10 Aug 2026 15:49:21 -0700 [thread overview]
Message-ID: <20260810224921.B3F0E1F000E9@smtp.kernel.org> (raw)
The patch titled
Subject: kasan: avoid unnecessary quarantine lock cycling
has been added to the -mm mm-new branch. Its filename is
kasan-avoid-unnecessary-quarantine-lock-cycling.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/kasan-avoid-unnecessary-quarantine-lock-cycling.patch
This patch will later appear in the mm-new branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Note, mm-new is a provisional staging ground for work-in-progress
patches, and acceptance into mm-new is a notification for others take
notice and to finish up reviews. Please do not hesitate to respond to
review feedback and post updated versions to replace or incrementally
fixup patches in mm-new.
The mm-new branch of mm.git is not included in linux-next
If a few days of testing in mm-new is successful, the patch will me moved
into mm.git's mm-unstable branch, which is included in linux-next
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via various
branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there most days
------------------------------------------------------
From: Hui Su <sh_def@163.com>
Subject: kasan: avoid unnecessary quarantine lock cycling
Date: Sun, 9 Aug 2026 03:12:31 +0800
kasan_quarantine_remove_cache() drops quarantine_lock and restores
interrupts after scanning each non-empty quarantine batch so that
cond_resched() can schedule during a long scan.
When no reschedule is pending, the unlock/IRQ restore and subsequent IRQ
save/relock cycle is unnecessary.
Check need_resched() before cycling quarantine_lock to avoid this overhead
when rescheduling is not needed.
Link: https://lore.kernel.org/20260808191230.3345930-2-sh_def@163.com
Signed-off-by: Hui Su <sh_def@163.com>
Suggested-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Alexander Potapenko <glider@google.com>
Cc: Andrey Konovalov <andreyknvl@gmail.com>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/kasan/quarantine.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
--- a/mm/kasan/quarantine.c~kasan-avoid-unnecessary-quarantine-lock-cycling
+++ a/mm/kasan/quarantine.c
@@ -373,10 +373,12 @@ void kasan_quarantine_remove_cache(struc
if (qlist_empty(&global_quarantine[i]))
continue;
qlist_move_cache(&global_quarantine[i], &to_free, cache);
- /* Scanning whole quarantine can take a while. */
- raw_spin_unlock_irqrestore(&quarantine_lock, flags);
- cond_resched();
- raw_spin_lock_irqsave(&quarantine_lock, flags);
+ if (need_resched()) {
+ /* Scanning whole quarantine can take a while. */
+ raw_spin_unlock_irqrestore(&quarantine_lock, flags);
+ cond_resched();
+ raw_spin_lock_irqsave(&quarantine_lock, flags);
+ }
}
raw_spin_unlock_irqrestore(&quarantine_lock, flags);
_
Patches currently in -mm which might be from sh_def@163.com are
kasan-fix-cache-shrink-race-with-cpu-hotplug.patch
kasan-avoid-unnecessary-quarantine-lock-cycling.patch
reply other threads:[~2026-08-10 22:49 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20260810224921.B3F0E1F000E9@smtp.kernel.org \
--to=akpm@linux-foundation.org \
--cc=andreyknvl@gmail.com \
--cc=dvyukov@google.com \
--cc=glider@google.com \
--cc=mm-commits@vger.kernel.org \
--cc=ryabinin.a.a@gmail.com \
--cc=sh_def@163.com \
--cc=vincenzo.frascino@arm.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.