diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2011-06-08 01:13:27 +0200 |
---|---|---|
committer | Frederic Weisbecker <fweisbec@gmail.com> | 2011-06-10 15:15:40 +0200 |
commit | bdd4e85dc36cdbcfc1608a5b2a17c80a9db8986a (patch) | |
tree | 9cee98e78a5aa6a00f3b7ce805b1e39a0137b4a4 /kernel | |
parent | 2da8c8bc44b572cbf623629ff736608dc7968436 (diff) | |
download | op-kernel-dev-bdd4e85dc36cdbcfc1608a5b2a17c80a9db8986a.zip op-kernel-dev-bdd4e85dc36cdbcfc1608a5b2a17c80a9db8986a.tar.gz |
sched: Isolate preempt counting in its own config option
Create a new CONFIG_PREEMPT_COUNT that handles the inc/dec
of preempt count offset independently. So that the offset
can be updated by preempt_disable() and preempt_enable()
even without the need for CONFIG_PREEMPT beeing set.
This prepares to make CONFIG_DEBUG_SPINLOCK_SLEEP working
with !CONFIG_PREEMPT where it currently doesn't detect
code that sleeps inside explicit preemption disabled
sections.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/Kconfig.preempt | 3 | ||||
-rw-r--r-- | kernel/sched.c | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/kernel/Kconfig.preempt b/kernel/Kconfig.preempt index bf987b9..24e7cb0 100644 --- a/kernel/Kconfig.preempt +++ b/kernel/Kconfig.preempt @@ -35,6 +35,7 @@ config PREEMPT_VOLUNTARY config PREEMPT bool "Preemptible Kernel (Low-Latency Desktop)" + select PREEMPT_COUNT help This option reduces the latency of the kernel by making all kernel code (that is not executing in a critical section) @@ -52,3 +53,5 @@ config PREEMPT endchoice +config PREEMPT_COUNT + bool
\ No newline at end of file diff --git a/kernel/sched.c b/kernel/sched.c index 01d9536..90ad7cf 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -2843,7 +2843,7 @@ void sched_fork(struct task_struct *p) #if defined(CONFIG_SMP) p->on_cpu = 0; #endif -#ifdef CONFIG_PREEMPT +#ifdef CONFIG_PREEMPT_COUNT /* Want to start with kernel preemption disabled. */ task_thread_info(p)->preempt_count = 1; #endif |