cgroup: consolidate cgroup_attach_task() and cgroup_attach_proc()
PATCH v2 1/1 cgroup: consolidate cgroup_attach_task() and cgroup_attach_proc()
These two functions share most of the code.
Signed-off-by Li Zefan <[email protected]>
---
v2: Not necessary to move cgroup_attach_task_all().
--- include/linux/cgroup.h | 3 +- kernel/cgroup.c | 109 +++++++++---------------------------------------- kernel/cpuset.c | 2 +- 3 files changed, 23 insertions(+), 91 deletions(-)
include/linux/cgroup.h +2 -1
@@ -691,7 +691,8 @@ struct task_struct *cgroup_iter_next(struct cgroup *cgrp, struct cgroup_iter *it);void cgroup_iter_end (struct cgroup *cgrp,struct cgroup_iter *it);int cgroup_scan_tasks (struct cgroup_scanner *scan); -int cgroup_attach_task (struct cgroup *,struct task_struct *); +int cgroup_attach_task (struct cgroup *cgrp,struct task_struct *tsk, +bool threadgroup);int cgroup_attach_task_all (struct task_struct *from,struct task_struct *);/*
kernel/cgroup.c +20 -89
166 lines not on this page · raw message
kernel/cpuset.c +1 -1
@@ -2008,7 +2008,7 @@ static void cpuset_do_move_task(struct task_struct *tsk,struct cgroup *new_cgroup = scan->data;cgroup_lock (); -cgroup_attach_task (new_cgroup, tsk); +cgroup_attach_task (new_cgroup, tsk, false);cgroup_unlock (); }
Signature · 1 line
1.8.0.2
Tejun Heo
maintainerQuoted 6 lines · Li Zefan
These two functions share most of the code.
Signed-off-by Li Zefan <[email protected]>---
v2: Not necessary to move
cgroup_attach_task_all().
I supposed this one is the one to apply?
Signature · 1 line
tejun
Quoted 10 lines · Tejun Heo
Quoted 6 lines · Li Zefan
These two functions share most of the code.
Signed-off-by Li Zefan <[email protected]>---
v2: Not necessary to move
cgroup_attach_task_all().I supposed this one is the one to apply?
yep.
Quoted 3 lines · Li Zefan
These two functions share most of the code.
Signed-off-by Li Zefan <[email protected]>
Applied to cgroup/for-3.10.
Thanks.
Signature · 1 line
tejun