diff options
author | Roman Gushchin <guro@fb.com> | 2019-07-11 23:56:20 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-07-12 14:05:44 -0400 |
commit | 570332978ea7fdbec86a07086a584d796a87da2c (patch) | |
tree | d75089cb6d3ed00067792acfd1c01e50a59ab75d | |
parent | 6cea1d569d24af6f9e95f70cb301807440ae2981 (diff) |
mm: memcg/slab: don't check the dying flag on kmem_cache creation
There is no point in checking the root_cache->memcg_params.dying flag on
kmem_cache creation path. New allocations shouldn't be performed using a
dead root kmem_cache, so no new memcg kmem_cache creation can be scheduled
after the flag is set. And if it was scheduled before,
flush_memcg_workqueue() will wait for it anyway.
So let's drop this check to simplify the code.
Link: http://lkml.kernel.org/r/20190611231813.3148843-7-guro@fb.com
Signed-off-by: Roman Gushchin <guro@fb.com>
Acked-by: Vladimir Davydov <vdavydov.dev@gmail.com>
Reviewed-by: Shakeel Butt <shakeelb@google.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Waiman Long <longman@redhat.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Andrei Vagin <avagin@gmail.com>
Cc: Qian Cai <cai@lca.pw>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | mm/slab_common.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/slab_common.c b/mm/slab_common.c index 62733bbcc971..afdd73553b88 100644 --- a/mm/slab_common.c +++ b/mm/slab_common.c | |||
@@ -640,7 +640,7 @@ void memcg_create_kmem_cache(struct mem_cgroup *memcg, | |||
640 | * The memory cgroup could have been offlined while the cache | 640 | * The memory cgroup could have been offlined while the cache |
641 | * creation work was pending. | 641 | * creation work was pending. |
642 | */ | 642 | */ |
643 | if (memcg->kmem_state != KMEM_ONLINE || root_cache->memcg_params.dying) | 643 | if (memcg->kmem_state != KMEM_ONLINE) |
644 | goto out_unlock; | 644 | goto out_unlock; |
645 | 645 | ||
646 | idx = memcg_cache_id(memcg); | 646 | idx = memcg_cache_id(memcg); |