diff options
author | Tejun Heo <tj@kernel.org> | 2016-04-22 01:09:02 +0200 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2016-04-25 21:45:14 +0200 |
commit | 264a0ae164bc0e9144bebcd25ff030d067b1a878 (patch) | |
tree | dde501787be0f898cfc460d6d09fde7da0e0d6ba /fs/kernfs/dir.c | |
parent | cgroup, cpuset: replace cpuset_post_attach_flush() with cgroup_subsys->post_a... (diff) | |
download | linux-264a0ae164bc0e9144bebcd25ff030d067b1a878.tar.xz linux-264a0ae164bc0e9144bebcd25ff030d067b1a878.zip |
memcg: relocate charge moving from ->attach to ->post_attach
Hello,
So, this ended up a lot simpler than I originally expected. I tested
it lightly and it seems to work fine. Petr, can you please test these
two patches w/o the lru drain drop patch and see whether the problem
is gone?
Thanks.
------ 8< ------
If charge moving is used, memcg performs relabeling of the affected
pages from its ->attach callback which is called under both
cgroup_threadgroup_rwsem and thus can't create new kthreads. This is
fragile as various operations may depend on workqueues making forward
progress which relies on the ability to create new kthreads.
There's no reason to perform charge moving from ->attach which is deep
in the task migration path. Move it to ->post_attach which is called
after the actual migration is finished and cgroup_threadgroup_rwsem is
dropped.
* move_charge_struct->mm is added and ->can_attach is now responsible
for pinning and recording the target mm. mem_cgroup_clear_mc() is
updated accordingly. This also simplifies mem_cgroup_move_task().
* mem_cgroup_move_task() is now called from ->post_attach instead of
->attach.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Michal Hocko <mhocko@kernel.org>
Debugged-and-tested-by: Petr Mladek <pmladek@suse.com>
Reported-by: Cyril Hrubis <chrubis@suse.cz>
Reported-by: Johannes Weiner <hannes@cmpxchg.org>
Fixes: 1ed1328792ff ("sched, cgroup: replace signal_struct->group_rwsem with a global percpu_rwsem")
Cc: <stable@vger.kernel.org> # 4.4+
Diffstat (limited to 'fs/kernfs/dir.c')
0 files changed, 0 insertions, 0 deletions