Skip to contentSkip to conversation

cgroup: consolidate cgroup_attach_task() and cgroup_attach_proc()

PATCH Superseded Li Zefan 1 participant 1 message Mar 13, 2013 cgroup

lore
Share & tools
lore

Li Zefan

author
#0 lore raw

PATCH v2 1/1 cgroup: consolidate cgroup_attach_task() and cgroup_attach_proc()

These two functions share most of the code.

---

v2: not necessary to move cgroup_attach_task_all()

---
 include/linux/cgroup.h |   3 +-
 kernel/cgroup.c        | 107 +++++++++----------------------------------------
 kernel/cpuset.c        |   2 +-
 3 files changed, 22 insertions(+), 90 deletions(-)
include/linux/cgroup.h +2 -1
index 1f75a59..013c6ce 100644
@@ -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 +19 -88

165 lines not on this page · raw message

kernel/cpuset.c +1 -1
index ace5bfc..c55763b 100644
@@ -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