All of lore.kernel.org
 help / color / mirror / Atom feed
* [nacked] kasan-avoid-unnecessary-quarantine-lock-cycling.patch removed from -mm tree
@ 2026-08-11 21:50 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2026-08-11 21:50 UTC (permalink / raw)
  To: mm-commits, vincenzo.frascino, ryabinin.a.a, glider, dvyukov,
	andreyknvl, akpm, sh_def, akpm


The quilt patch titled
     Subject: kasan: avoid unnecessary quarantine lock cycling
has been removed from the -mm tree.  Its filename was
     kasan-avoid-unnecessary-quarantine-lock-cycling.patch

This patch was dropped because it was nacked

------------------------------------------------------
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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-11 21:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-11 21:50 [nacked] kasan-avoid-unnecessary-quarantine-lock-cycling.patch removed from -mm tree Andrew Morton

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.