diff options
Diffstat (limited to 'kernel/cpuset.c')
-rw-r--r-- | kernel/cpuset.c | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 3778a21a4662..0619f109d38d 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c | |||
@@ -128,10 +128,6 @@ static inline struct cpuset *task_cs(struct task_struct *task) | |||
128 | return container_of(task_subsys_state(task, cpuset_subsys_id), | 128 | return container_of(task_subsys_state(task, cpuset_subsys_id), |
129 | struct cpuset, css); | 129 | struct cpuset, css); |
130 | } | 130 | } |
131 | struct cpuset_hotplug_scanner { | ||
132 | struct cgroup_scanner scan; | ||
133 | struct cgroup *to; | ||
134 | }; | ||
135 | 131 | ||
136 | /* bits in struct cpuset flags field */ | 132 | /* bits in struct cpuset flags field */ |
137 | typedef enum { | 133 | typedef enum { |
@@ -1890,10 +1886,9 @@ int __init cpuset_init(void) | |||
1890 | static void cpuset_do_move_task(struct task_struct *tsk, | 1886 | static void cpuset_do_move_task(struct task_struct *tsk, |
1891 | struct cgroup_scanner *scan) | 1887 | struct cgroup_scanner *scan) |
1892 | { | 1888 | { |
1893 | struct cpuset_hotplug_scanner *chsp; | 1889 | struct cgroup *new_cgroup = scan->data; |
1894 | 1890 | ||
1895 | chsp = container_of(scan, struct cpuset_hotplug_scanner, scan); | 1891 | cgroup_attach_task(new_cgroup, tsk); |
1896 | cgroup_attach_task(chsp->to, tsk); | ||
1897 | } | 1892 | } |
1898 | 1893 | ||
1899 | /** | 1894 | /** |
@@ -1909,15 +1904,15 @@ static void cpuset_do_move_task(struct task_struct *tsk, | |||
1909 | */ | 1904 | */ |
1910 | static void move_member_tasks_to_cpuset(struct cpuset *from, struct cpuset *to) | 1905 | static void move_member_tasks_to_cpuset(struct cpuset *from, struct cpuset *to) |
1911 | { | 1906 | { |
1912 | struct cpuset_hotplug_scanner scan; | 1907 | struct cgroup_scanner scan; |
1913 | 1908 | ||
1914 | scan.scan.cg = from->css.cgroup; | 1909 | scan.cg = from->css.cgroup; |
1915 | scan.scan.test_task = NULL; /* select all tasks in cgroup */ | 1910 | scan.test_task = NULL; /* select all tasks in cgroup */ |
1916 | scan.scan.process_task = cpuset_do_move_task; | 1911 | scan.process_task = cpuset_do_move_task; |
1917 | scan.scan.heap = NULL; | 1912 | scan.heap = NULL; |
1918 | scan.to = to->css.cgroup; | 1913 | scan.data = to->css.cgroup; |
1919 | 1914 | ||
1920 | if (cgroup_scan_tasks(&scan.scan)) | 1915 | if (cgroup_scan_tasks(&scan)) |
1921 | printk(KERN_ERR "move_member_tasks_to_cpuset: " | 1916 | printk(KERN_ERR "move_member_tasks_to_cpuset: " |
1922 | "cgroup_scan_tasks failed\n"); | 1917 | "cgroup_scan_tasks failed\n"); |
1923 | } | 1918 | } |