diff options
author | Tejun Heo <tj@kernel.org> | 2015-09-11 15:00:20 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2015-09-22 12:46:53 -0400 |
commit | 9af2ec45c2d323d5ce35b431bb150c0eb567f19a (patch) | |
tree | 41dfc78fa210fde6670aa2ad956aa553b402846f | |
parent | 4530eddb59494b89650d6bcd980fc7f7717ad80c (diff) |
cgroup: reorder cgroup_migrate()'s parameters
cgroup_migrate() has the destination cgroup as the first parameter
while cgroup_task_migrate() has the destination cset as the last.
Another migration function is scheduled to be added which can make the
discrepancy further stand out. Let's reorder cgroup_migrate()'s
parameters so that the destination cgroup is the last.
This doesn't cause any functional difference.
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Zefan Li <lizefan@huawei.com>
-rw-r--r-- | kernel/cgroup.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 7f4b85af03dc..dc079560dd53 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c | |||
@@ -2362,9 +2362,9 @@ err: | |||
2362 | 2362 | ||
2363 | /** | 2363 | /** |
2364 | * cgroup_migrate - migrate a process or task to a cgroup | 2364 | * cgroup_migrate - migrate a process or task to a cgroup |
2365 | * @cgrp: the destination cgroup | ||
2366 | * @leader: the leader of the process or the task to migrate | 2365 | * @leader: the leader of the process or the task to migrate |
2367 | * @threadgroup: whether @leader points to the whole process or a single task | 2366 | * @threadgroup: whether @leader points to the whole process or a single task |
2367 | * @cgrp: the destination cgroup | ||
2368 | * | 2368 | * |
2369 | * Migrate a process or task denoted by @leader to @cgrp. If migrating a | 2369 | * Migrate a process or task denoted by @leader to @cgrp. If migrating a |
2370 | * process, the caller must be holding cgroup_threadgroup_rwsem. The | 2370 | * process, the caller must be holding cgroup_threadgroup_rwsem. The |
@@ -2378,8 +2378,8 @@ err: | |||
2378 | * decided for all targets by invoking group_migrate_prepare_dst() before | 2378 | * decided for all targets by invoking group_migrate_prepare_dst() before |
2379 | * actually starting migrating. | 2379 | * actually starting migrating. |
2380 | */ | 2380 | */ |
2381 | static int cgroup_migrate(struct cgroup *cgrp, struct task_struct *leader, | 2381 | static int cgroup_migrate(struct task_struct *leader, bool threadgroup, |
2382 | bool threadgroup) | 2382 | struct cgroup *cgrp) |
2383 | { | 2383 | { |
2384 | struct cgroup_taskset tset = { | 2384 | struct cgroup_taskset tset = { |
2385 | .src_csets = LIST_HEAD_INIT(tset.src_csets), | 2385 | .src_csets = LIST_HEAD_INIT(tset.src_csets), |
@@ -2516,7 +2516,7 @@ static int cgroup_attach_task(struct cgroup *dst_cgrp, | |||
2516 | /* prepare dst csets and commit */ | 2516 | /* prepare dst csets and commit */ |
2517 | ret = cgroup_migrate_prepare_dst(dst_cgrp, &preloaded_csets); | 2517 | ret = cgroup_migrate_prepare_dst(dst_cgrp, &preloaded_csets); |
2518 | if (!ret) | 2518 | if (!ret) |
2519 | ret = cgroup_migrate(dst_cgrp, leader, threadgroup); | 2519 | ret = cgroup_migrate(leader, threadgroup, dst_cgrp); |
2520 | 2520 | ||
2521 | cgroup_migrate_finish(&preloaded_csets); | 2521 | cgroup_migrate_finish(&preloaded_csets); |
2522 | return ret; | 2522 | return ret; |
@@ -2823,7 +2823,7 @@ static int cgroup_update_dfl_csses(struct cgroup *cgrp) | |||
2823 | goto out_finish; | 2823 | goto out_finish; |
2824 | last_task = task; | 2824 | last_task = task; |
2825 | 2825 | ||
2826 | ret = cgroup_migrate(src_cset->dfl_cgrp, task, true); | 2826 | ret = cgroup_migrate(task, true, src_cset->dfl_cgrp); |
2827 | 2827 | ||
2828 | put_task_struct(task); | 2828 | put_task_struct(task); |
2829 | 2829 | ||
@@ -3905,7 +3905,7 @@ int cgroup_transfer_tasks(struct cgroup *to, struct cgroup *from) | |||
3905 | css_task_iter_end(&it); | 3905 | css_task_iter_end(&it); |
3906 | 3906 | ||
3907 | if (task) { | 3907 | if (task) { |
3908 | ret = cgroup_migrate(to, task, false); | 3908 | ret = cgroup_migrate(task, false, to); |
3909 | put_task_struct(task); | 3909 | put_task_struct(task); |
3910 | } | 3910 | } |
3911 | } while (task && !ret); | 3911 | } while (task && !ret); |