]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mm, slub: detach whole partial list at once 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:30 +0000 (09:33 +1000)
Instead of iterating through the live percpu partial list, detach it from
the kmem_cache_cpu at once.  This is simpler and will allow further
optimization.

Link: https://lkml.kernel.org/r/20210805152000.12817-25-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 240b22328212b0aeab7f4423da28b22afa4f9109..d8bfc41dc1f0f9c8fcfdf2bd9ba69428dba8a076 100644 (file)
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -2344,16 +2344,20 @@ static void unfreeze_partials(struct kmem_cache *s,
 {
 #ifdef CONFIG_SLUB_CPU_PARTIAL
        struct kmem_cache_node *n = NULL, *n2 = NULL;
-       struct page *page, *discard_page = NULL;
+       struct page *page, *partial_page, *discard_page = NULL;
        unsigned long flags;
 
        local_irq_save(flags);
 
-       while ((page = slub_percpu_partial(c))) {
+       partial_page = slub_percpu_partial(c);
+       c->partial = NULL;
+
+       while (partial_page) {
                struct page new;
                struct page old;
 
-               slub_set_percpu_partial(c, page);
+               page = partial_page;
+               partial_page = page->next;
 
                n2 = get_node(s, page_to_nid(page));
                if (n != n2) {