aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWei Yang <[email protected]>2018-12-28 00:33:06 -0800
committerLinus Torvalds <[email protected]>2018-12-28 12:11:46 -0800
commit1265ef2de4cef44cec91ba47009958eec6162836 (patch)
tree829d03751e11bc48f8c1e72488a713e6c7559bbc
parent221d7da66cd3435b28a0404f62168d25f57aca4e (diff)
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/[email protected] Signed-off-by: Wei Yang <[email protected]> Reviewed-by: Andrew Morton <[email protected]> Cc: Christoph Lameter <[email protected]> Cc: Pekka Enberg <[email protected]> Cc: David Rientjes <[email protected]> Cc: Joonsoo Kim <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r--mm/slub.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/mm/slub.c b/mm/slub.c
index 08740c3f3745..3fd791c0dae5 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)