]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mm, slub: only disable irq with spin_lock in __unfreeze_partials()
authorVlastimil Babka <vbabka@suse.cz>
Mon, 23 Aug 2021 23:59:00 +0000 (09:59 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 25 Aug 2021 23:33:31 +0000 (09:33 +1000)
__unfreeze_partials() no longer needs to have irqs disabled, except for
making the spin_lock operations irq-safe, so convert the spin_locks
operations and remove the separate irq handling.

Link: https://lkml.kernel.org/r/20210805152000.12817-27-vbabka@suse.cz
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Christoph Lameter <cl@linux.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Jann Horn <jannh@google.com>
Cc: Jesper Dangaard Brouer <brouer@redhat.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
mm/slub.c

index 5f57e36e93ef9ae33989645944b6d5b6bfc00d20..fc09ec3563b4d11e244f2a6df88e5ac0db2053c7 100644 (file)
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -2338,9 +2338,7 @@ static void __unfreeze_partials(struct kmem_cache *s, struct page *partial_page)
 {
        struct kmem_cache_node *n = NULL, *n2 = NULL;
        struct page *page, *discard_page = NULL;
-       unsigned long flags;
-
-       local_irq_save(flags);
+       unsigned long flags = 0;
 
        while (partial_page) {
                struct page new;
@@ -2352,10 +2350,10 @@ static void __unfreeze_partials(struct kmem_cache *s, struct page *partial_page)
                n2 = get_node(s, page_to_nid(page));
                if (n != n2) {
                        if (n)
-                               spin_unlock(&n->list_lock);
+                               spin_unlock_irqrestore(&n->list_lock, flags);
 
                        n = n2;
-                       spin_lock(&n->list_lock);
+                       spin_lock_irqsave(&n->list_lock, flags);
                }
 
                do {
@@ -2384,9 +2382,7 @@ static void __unfreeze_partials(struct kmem_cache *s, struct page *partial_page)
        }
 
        if (n)
-               spin_unlock(&n->list_lock);
-
-       local_irq_restore(flags);
+               spin_unlock_irqrestore(&n->list_lock, flags);
 
        while (discard_page) {
                page = discard_page;