]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
cgroup: drop @skip_css from cgroup_taskset_for_each()
authorTejun Heo <tj@kernel.org>
Thu, 13 Feb 2014 11:58:41 +0000 (06:58 -0500)
committerTejun Heo <tj@kernel.org>
Thu, 13 Feb 2014 11:58:41 +0000 (06:58 -0500)
If !NULL, @skip_css makes cgroup_taskset_for_each() skip the matching
css.  The intention of the interface is to make it easy to skip css's
(cgroup_subsys_states) which already match the migration target;
however, this is entirely unnecessary as migration taskset doesn't
include tasks which are already in the target cgroup.  Drop @skip_css
from cgroup_taskset_for_each().

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Li Zefan <lizefan@huawei.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: Daniel Borkmann <dborkman@redhat.com>
block/blk-cgroup.c
include/linux/cgroup.h
kernel/cgroup_freezer.c
kernel/cpuset.c
kernel/events/core.c
kernel/sched/core.c
net/core/netclassid_cgroup.c
net/core/netprio_cgroup.c

index 1cef07cf9c213cd5810940a9a0b60d3ddbdc3d9c..4aefd46d7d95b4d4e4666704da34810af83b2137 100644 (file)
@@ -894,7 +894,7 @@ static int blkcg_can_attach(struct cgroup_subsys_state *css,
        int ret = 0;
 
        /* task_lock() is needed to avoid races with exit_io_context() */
-       cgroup_taskset_for_each(task, css, tset) {
+       cgroup_taskset_for_each(task, tset) {
                task_lock(task);
                ioc = task->io_context;
                if (ioc && atomic_read(&ioc->nr_tasks) > 1)
index 3bd0a71383711194799bb3b576931dc98b9cbcef..581a124c7bc89d1fda7eaa707c42fe4ae80c8b75 100644 (file)
@@ -535,15 +535,11 @@ int cgroup_taskset_size(struct cgroup_taskset *tset);
 /**
  * cgroup_taskset_for_each - iterate cgroup_taskset
  * @task: the loop cursor
- * @skip_css: skip if task's css matches this, %NULL to iterate through all
  * @tset: taskset to iterate
  */
-#define cgroup_taskset_for_each(task, skip_css, tset)                  \
+#define cgroup_taskset_for_each(task, tset)                            \
        for ((task) = cgroup_taskset_first((tset)); (task);             \
-            (task) = cgroup_taskset_next((tset)))                      \
-               if (!(skip_css) ||                                      \
-                   cgroup_taskset_cur_css((tset),                      \
-                       (skip_css)->ss->id) != (skip_css))
+            (task) = cgroup_taskset_next((tset)))
 
 /*
  * Control Group subsystem type.
index 98ea26a99076198601b98ce2829b6ff5e741b74e..7201a637c4058fdfc0bd8787006bafbbb66ac32b 100644 (file)
@@ -187,7 +187,7 @@ static void freezer_attach(struct cgroup_subsys_state *new_css,
         * current state before executing the following - !frozen tasks may
         * be visible in a FROZEN cgroup and frozen tasks in a THAWED one.
         */
-       cgroup_taskset_for_each(task, new_css, tset) {
+       cgroup_taskset_for_each(task, tset) {
                if (!(freezer->state & CGROUP_FREEZING)) {
                        __thaw_task(task);
                } else {
index 65ae0bdf4af84a3d53333ecda680cbc236f2ce76..bf20e4ac2f75da122ced42fa0870470a76cb52ac 100644 (file)
@@ -1398,7 +1398,7 @@ static int cpuset_can_attach(struct cgroup_subsys_state *css,
            (cpumask_empty(cs->cpus_allowed) || nodes_empty(cs->mems_allowed)))
                goto out_unlock;
 
-       cgroup_taskset_for_each(task, css, tset) {
+       cgroup_taskset_for_each(task, tset) {
                /*
                 * Kthreads which disallow setaffinity shouldn't be moved
                 * to a new cpuset; we don't want to change their cpu
@@ -1467,7 +1467,7 @@ static void cpuset_attach(struct cgroup_subsys_state *css,
 
        guarantee_online_mems(mems_cs, &cpuset_attach_nodemask_to);
 
-       cgroup_taskset_for_each(task, css, tset) {
+       cgroup_taskset_for_each(task, tset) {
                /*
                 * can_attach beforehand should guarantee that this doesn't
                 * fail.  TODO: have a better way to handle failure here
index a3c3ab50271af3453845c1bb925fe03e811e0b1b..6dd714955b04d4763987c5247936ff7e303ca330 100644 (file)
@@ -8021,7 +8021,7 @@ static void perf_cgroup_attach(struct cgroup_subsys_state *css,
 {
        struct task_struct *task;
 
-       cgroup_taskset_for_each(task, css, tset)
+       cgroup_taskset_for_each(task, tset)
                task_function_call(task, __perf_cgroup_move, task);
 }
 
index d4cfc5561830dc870eae869fabed3a83b5df8824..ba386a06ab11bc0f9e682f87cd754193388aab7d 100644 (file)
@@ -7600,7 +7600,7 @@ static int cpu_cgroup_can_attach(struct cgroup_subsys_state *css,
 {
        struct task_struct *task;
 
-       cgroup_taskset_for_each(task, css, tset) {
+       cgroup_taskset_for_each(task, tset) {
 #ifdef CONFIG_RT_GROUP_SCHED
                if (!sched_rt_can_attach(css_tg(css), task))
                        return -EINVAL;
@@ -7618,7 +7618,7 @@ static void cpu_cgroup_attach(struct cgroup_subsys_state *css,
 {
        struct task_struct *task;
 
-       cgroup_taskset_for_each(task, css, tset)
+       cgroup_taskset_for_each(task, tset)
                sched_move_task(task);
 }
 
index b865662fba713c96db485aca31e5e19a9fbe886b..22931e1b99b4e92a23222e30862b621ea3f9e43c 100644 (file)
@@ -73,7 +73,7 @@ static void cgrp_attach(struct cgroup_subsys_state *css,
        void *v = (void *)(unsigned long)cs->classid;
        struct task_struct *p;
 
-       cgroup_taskset_for_each(p, css, tset) {
+       cgroup_taskset_for_each(p, tset) {
                task_lock(p);
                iterate_fd(p->files, 0, update_classid, v);
                task_unlock(p);
index d7d23e28fafda0097655b9df1ec54b57ee75eb3c..f9f3a40d3350e8f7ecd731c2c9ddbd226973a170 100644 (file)
@@ -224,7 +224,7 @@ static void net_prio_attach(struct cgroup_subsys_state *css,
        struct task_struct *p;
        void *v = (void *)(unsigned long)css->cgroup->id;
 
-       cgroup_taskset_for_each(p, css, tset) {
+       cgroup_taskset_for_each(p, tset) {
                task_lock(p);
                iterate_fd(p->files, 0, update_netprio, v);
                task_unlock(p);