]> www.infradead.org Git - users/willy/linux.git/commitdiff
mm/slub: Convert slab flushing to struct slab
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Fri, 1 Oct 2021 19:47:19 +0000 (15:47 -0400)
committerMatthew Wilcox (Oracle) <willy@infradead.org>
Mon, 4 Oct 2021 13:17:59 +0000 (09:17 -0400)
Moves a few calls to slab_page() around.  Gets us a step closer to
allowing deactivate_slab() to take a slab instead of a page.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
mm/slub.c

index e6c363d8de227da4fa38093d3b48435d74b67059..f33a196fe64f0f47f9ec5c2493f5e9e784bf4358 100644 (file)
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -2588,12 +2588,12 @@ static inline void unfreeze_partials_cpu(struct kmem_cache *s,
 static inline void flush_slab(struct kmem_cache *s, struct kmem_cache_cpu *c)
 {
        unsigned long flags;
-       struct page *page;
+       struct slab *slab;
        void *freelist;
 
        local_lock_irqsave(&s->cpu_slab->lock, flags);
 
-       page = slab_page(c->slab);
+       slab = c->slab;
        freelist = c->freelist;
 
        c->slab = NULL;
@@ -2602,8 +2602,8 @@ static inline void flush_slab(struct kmem_cache *s, struct kmem_cache_cpu *c)
 
        local_unlock_irqrestore(&s->cpu_slab->lock, flags);
 
-       if (page) {
-               deactivate_slab(s, page, freelist);
+       if (slab) {
+               deactivate_slab(s, slab_page(slab), freelist);
                stat(s, CPUSLAB_FLUSH);
        }
 }
@@ -2612,14 +2612,14 @@ static inline void __flush_cpu_slab(struct kmem_cache *s, int cpu)
 {
        struct kmem_cache_cpu *c = per_cpu_ptr(s->cpu_slab, cpu);
        void *freelist = c->freelist;
-       struct page *page = slab_page(c->slab);
+       struct slab *slab = c->slab;
 
        c->slab = NULL;
        c->freelist = NULL;
        c->tid = next_tid(c->tid);
 
-       if (page) {
-               deactivate_slab(s, page, freelist);
+       if (slab) {
+               deactivate_slab(s, slab_page(slab), freelist);
                stat(s, CPUSLAB_FLUSH);
        }