From: Wei Yang Date: Fri, 28 Dec 2018 08:33:06 +0000 (-0800) Subject: mm/slub.c: remove validation on cpu_slab in __flush_cpu_slab() X-Git-Tag: v5.4-rc1~1935^2~111 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1265ef2de4cef44cec91ba47009958eec6162836;p=platform%2Fkernel%2Flinux-rpi.git mm/slub.c: remove validation on cpu_slab in __flush_cpu_slab() 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(). Link: http://lkml.kernel.org/r/20181103141218.22844-1-richard.weiyang@gmail.com Signed-off-by: Wei Yang Reviewed-by: Andrew Morton Cc: Christoph Lameter Cc: Pekka Enberg Cc: David Rientjes Cc: Joonsoo Kim Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/slub.c b/mm/slub.c index 08740c3..3fd791c 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -2317,12 +2317,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)