public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sched: shorten setting the allowed cpu mask of task
@ 2011-05-06 12:52 Hillf Danton
  2011-05-09  4:39 ` Yong Zhang
  0 siblings, 1 reply; 6+ messages in thread
From: Hillf Danton @ 2011-05-06 12:52 UTC (permalink / raw)
  To: LKML; +Cc: Ingo Molnar, Peter Zijlstra, Mike Galbraith, Yong Zhang

When setting the allowed cpu mask for a given task, if the task is
already bound to certain cpu, after checking the validity of the new
mask of allowed cpus, job is done, and no further efforts needed for
the valid case as well.

Signed-off-by: Hillf Danton <dhillf@gmail.com>
---

--- a/kernel/sched.c	2011-04-27 11:48:50.000000000 +0800
+++ b/kernel/sched.c	2011-05-06 20:39:58.000000000 +0800
@@ -5899,9 +5899,9 @@ again:
 		goto out;
 	}

-	if (unlikely((p->flags & PF_THREAD_BOUND) && p != current &&
-		     !cpumask_equal(&p->cpus_allowed, new_mask))) {
-		ret = -EINVAL;
+	if ((p->flags & PF_THREAD_BOUND) && p != current) {
+		if (!cpumask_equal(&p->cpus_allowed, new_mask))
+			ret = -EINVAL;
 		goto out;
 	}

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-05-16 10:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-06 12:52 [PATCH] sched: shorten setting the allowed cpu mask of task Hillf Danton
2011-05-09  4:39 ` Yong Zhang
2011-05-09 12:52   ` Hillf Danton
2011-05-09 14:07     ` Yong Zhang
2011-05-10 12:38       ` Hillf Danton
2011-05-16 10:37       ` [tip:sched/core] sched: Avoid going ahead if ->cpus_allowed is not changed tip-bot for Yong Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox