diff options
Diffstat (limited to 'mm/memcontrol.c')
-rw-r--r-- | mm/memcontrol.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 6115b2bbd6ea..f45e21ab9cea 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
@@ -6326,9 +6326,23 @@ static void mem_cgroup_invalidate_reclaim_iterators(struct mem_cgroup *memcg) | |||
6326 | static void mem_cgroup_css_offline(struct cgroup *cont) | 6326 | static void mem_cgroup_css_offline(struct cgroup *cont) |
6327 | { | 6327 | { |
6328 | struct mem_cgroup *memcg = mem_cgroup_from_cont(cont); | 6328 | struct mem_cgroup *memcg = mem_cgroup_from_cont(cont); |
6329 | struct cgroup *iter; | ||
6329 | 6330 | ||
6330 | mem_cgroup_invalidate_reclaim_iterators(memcg); | 6331 | mem_cgroup_invalidate_reclaim_iterators(memcg); |
6332 | |||
6333 | /* | ||
6334 | * This requires that offlining is serialized. Right now that is | ||
6335 | * guaranteed because css_killed_work_fn() holds the cgroup_mutex. | ||
6336 | */ | ||
6337 | rcu_read_lock(); | ||
6338 | cgroup_for_each_descendant_post(iter, cont) { | ||
6339 | rcu_read_unlock(); | ||
6340 | mem_cgroup_reparent_charges(mem_cgroup_from_cont(iter)); | ||
6341 | rcu_read_lock(); | ||
6342 | } | ||
6343 | rcu_read_unlock(); | ||
6331 | mem_cgroup_reparent_charges(memcg); | 6344 | mem_cgroup_reparent_charges(memcg); |
6345 | |||
6332 | mem_cgroup_destroy_all_caches(memcg); | 6346 | mem_cgroup_destroy_all_caches(memcg); |
6333 | } | 6347 | } |
6334 | 6348 | ||