Skip to content

Commit 5703329

Browse files
rgushchintorvalds
authored andcommitted
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/[email protected] Signed-off-by: Roman Gushchin <[email protected]> Acked-by: Vladimir Davydov <[email protected]> Reviewed-by: Shakeel Butt <[email protected]> Cc: Christoph Lameter <[email protected]> Cc: Johannes Weiner <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Waiman Long <[email protected]> Cc: David Rientjes <[email protected]> Cc: Joonsoo Kim <[email protected]> Cc: Pekka Enberg <[email protected]> Cc: Andrei Vagin <[email protected]> Cc: Qian Cai <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 6cea1d5 commit 5703329

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/slab_common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ void memcg_create_kmem_cache(struct mem_cgroup *memcg,
640640
* The memory cgroup could have been offlined while the cache
641641
* creation work was pending.
642642
*/
643-
if (memcg->kmem_state != KMEM_ONLINE || root_cache->memcg_params.dying)
643+
if (memcg->kmem_state != KMEM_ONLINE)
644644
goto out_unlock;
645645

646646
idx = memcg_cache_id(memcg);

0 commit comments

Comments
 (0)