From: Tejun Heo <tj@kernel.org>
To: lizefan@huawei.com
Cc: cgroups@vger.kernel.org, hannes@cmpxchg.org, mhocko@suse.cz,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: [PATCHSET v2 cgroup/for-4.4] cgroup: make multi-process migration atomic
Date: Fri, 11 Sep 2015 15:00:17 -0400 [thread overview]
Message-ID: <1441998022-12953-1-git-send-email-tj@kernel.org> (raw)
Hello,
This is v2 of atomic multi-process migration patchset. This one
slipped through crack somehow. Changes from the last take[L] are.
* 0002-memcg-restructure-mem_cgroup_can_attach.patch already in
upstream.
* 0003-memcg-immigrate-charges-only-when-a-threadgroup-lead.patch
dropped and
0004-cgroup-memcg-cpuset-implement-cgroup_taskset_for_eac.patch
updated accordingly.
* Li's acks added and patchset refreshed.
When a controller is enabled or disabled on the unified hierarchy, the
effective css changes for all processes in the sub-hierarchy which
virtually is multi-process migration. This is implemented in
cgroup_update_dfl_csses() as process-by-process migration - all the
target source css_sets are first chained to the target list and
processes are drained from them one-by-one.
If a process gets rejected by a controller after some are successfully
migrated, the recovery action is tricky. The changes which have
happened upto this point have to be rolled back but there's nothing
guaranteeing such rollback would be successful either.
The unified hierarchy didn't need to deal with this issue because
organizational operations were expected to always succeed;
unfortunately, it turned out that such policy doesn't work too well
for certain type of resources and unified hierarchy would need to
allow migration failures for some restrictied cases.
This patch updates multi-process migration in
cgroup_update_dfl_csses() atomic so that ->can_attach() can fail the
whole transaction. It's consisted of the following seven patches.
0001-cpuset-migrate-memory-only-for-threadgroup-leaders.patch
0002-cgroup-memcg-cpuset-implement-cgroup_taskset_for_eac.patch
0003-reorder-cgroup_migrate-s-parameters.patch
0004-cgroup-separate-out-taskset-operations-from-cgroup_m.patch
0005-cgroup-make-cgroup_update_dfl_csses-migrate-all-targ.patch
0001-0002 prepare cpuset and memcg. Note that 0001 causes behavioral
changes in that mm is now always tied to the threadgroup leader.
Avoiding this change isn't too difficult but both the code and
behavior are saner this way and the change is unlikely to cause
breakage.
0003-0005 prepare and implement atomic multi-process migration.
This patchset is on top of 64d1def7d338 ("Merge tag
'sound-fix-4.3-rc1' of
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound").
and available in the following git branch.
git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git review-multi-process-migration
diffstat follows. Thanks.
include/linux/cgroup.h | 22 +++
kernel/cgroup.c | 278 ++++++++++++++++++++++++-------------------------
kernel/cpuset.c | 41 +++----
mm/memcontrol.c | 17 ++
4 files changed, 198 insertions(+), 160 deletions(-)
--
tejun
[L] http://lkml.kernel.org/g/1431978595-12176-1-git-send-email-tj@kernel.org
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next reply other threads:[~2015-09-11 19:00 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-11 19:00 Tejun Heo [this message]
2015-09-11 19:00 ` [PATCH 1/5] cpuset: migrate memory only for threadgroup leaders Tejun Heo
2015-09-11 19:00 ` [PATCH 2/5] cgroup, memcg, cpuset: implement cgroup_taskset_for_each_leader() Tejun Heo
2015-09-14 20:49 ` Tejun Heo
2015-09-18 16:04 ` Tejun Heo
2015-09-22 15:49 ` Michal Hocko
2015-09-11 19:00 ` [PATCH 3/5] reorder cgroup_migrate()'s parameters Tejun Heo
2015-09-11 19:00 ` [PATCH 4/5] cgroup: separate out taskset operations from cgroup_migrate() Tejun Heo
2015-09-11 19:00 ` [PATCH 5/5] cgroup: make cgroup_update_dfl_csses() migrate all target processes atomically Tejun Heo
2015-09-22 16:48 ` [PATCHSET v2 cgroup/for-4.4] cgroup: make multi-process migration atomic Tejun Heo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1441998022-12953-1-git-send-email-tj@kernel.org \
--to=tj@kernel.org \
--cc=cgroups@vger.kernel.org \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lizefan@huawei.com \
--cc=mhocko@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).