linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/slub: remove validation on cpu_slab in __flush_cpu_slab()
@ 2018-11-03 14:12 Wei Yang
  0 siblings, 0 replies; only message in thread
From: Wei Yang @ 2018-11-03 14:12 UTC (permalink / raw)
  To: cl, penberg; +Cc: akpm, linux-mm, Wei Yang

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

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

only message in thread, other threads:[~2018-11-03 14:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-03 14:12 [PATCH] mm/slub: remove validation on cpu_slab in __flush_cpu_slab() Wei Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox