diff mbox series

mm/slub: remove validation on cpu_slab in __flush_cpu_slab()

Message ID 20181103141218.22844-1-richard.weiyang@gmail.com (mailing list archive)
State New, archived
Headers show
Series mm/slub: remove validation on cpu_slab in __flush_cpu_slab() | expand

Commit Message

Wei Yang Nov. 3, 2018, 2:12 p.m. UTC
cpu_slab is a per cpu variable which is allocated in all or none. If a
cpu_slab failed to be allocated, the slub is not usable.

We could use cpu_slab without validation in __flush_cpu_slab().

Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
---
 mm/slub.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/mm/slub.c b/mm/slub.c
index 1b6c20ac2a08..eb93d767e87d 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -2291,12 +2291,10 @@  static inline void __flush_cpu_slab(struct kmem_cache *s, int cpu)
 {
 	struct kmem_cache_cpu *c = per_cpu_ptr(s->cpu_slab, cpu);
 
-	if (likely(c)) {
-		if (c->page)
-			flush_slab(s, c);
+	if (c->page)
+		flush_slab(s, c);
 
-		unfreeze_partials(s, c);
-	}
+	unfreeze_partials(s, c);
 }
 
 static void flush_cpu_slab(void *d)