Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 924f0d9a authored by Tejun Heo's avatar Tejun Heo
Browse files

cgroup: drop @skip_css from cgroup_taskset_for_each()



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: default avatarTejun Heo <tj@kernel.org>
Acked-by: default avatarLi 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>
parent cb0f1fe9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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)
+2 −6
Original line number Diff line number Diff line
@@ -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.
+1 −1
Original line number Diff line number Diff line
@@ -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 {
+2 −2
Original line number Diff line number Diff line
@@ -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
+1 −1
Original line number Diff line number Diff line
@@ -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);
}

Loading