lkml.org 
[lkml]   [2010]   [Dec]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC PATCH 13/15] sched: Protect nohz task cpu affinity
Date
Don't allow to change a nohz task cpu affinity as we want them
to be bound to a single CPU and we want this affinity not to
change.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Anton Blanchard <anton@au1.ibm.com>
Cc: Tim Pepper <lnxninja@linux.vnet.ibm.com>
---
kernel/sched.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/kernel/sched.c b/kernel/sched.c
index 4412493..bd0a41f 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -5712,6 +5712,13 @@ again:
goto out;
}

+ /* Nohz tasks must keep their affinity */
+ if (test_tsk_thread_flag(p, TIF_NOHZ) &&
+ !cpumask_equal(&p->cpus_allowed, new_mask)) {
+ ret = -EBUSY;
+ goto out;
+ }
+
if (p->sched_class->set_cpus_allowed)
p->sched_class->set_cpus_allowed(p, new_mask);
else {
--
1.7.3.2


\
 
 \ /
  Last update: 2010-12-20 16:29    [from the cache]
©2003-2011 Jasper Spaans