lkml.org 
[lkml]   [2011]   [May]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
Subject[PATCH] sched: shorten setting the allowed cpu mask of task
From
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;
}

\
 
 \ /
  Last update: 2011-05-06 14:55    [W:0.070 / U:0.212 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site