]> git.baikalelectronics.ru Git - kernel.git/commit
cpuset: migrate memory only for threadgroup leaders
authorTejun Heo <tj@kernel.org>
Fri, 11 Sep 2015 19:00:18 +0000 (15:00 -0400)
committerTejun Heo <tj@kernel.org>
Tue, 22 Sep 2015 16:46:53 +0000 (12:46 -0400)
commit3cf87c7fbfbee86554a1131dd71343d6da8f9f64
tree390c8b27ef61cca1d7d51b6372f545ac8b55cfcd
parentebad1a41e9f9d5faea88473e2415c6c8ea3b5c14
cpuset: migrate memory only for threadgroup leaders

If memory_migrate flag is set, cpuset migrates memory according to the
destnation css's nodemask.  The current implementation migrates memory
whenever any thread of a process is migrated making the behavior
somewhat arbitrary.  Let's tie memory operations to the threadgroup
leader so that memory is migrated only when the leader is migrated.

While this is a behavior change, given the inherent fuziness, this
change is not too likely to be noticed and allows us to clearly define
who owns the memory (always the leader) and helps the planned atomic
multi-process migration.

Note that we're currently migrating memory in migration path proper
while holding all the locks.  In the long term, this should be moved
out to an async work item.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Zefan Li <lizefan@huawei.com>
kernel/cpuset.c