aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2011-07-01 07:20:51 -0400
committerIngo Molnar <mingo@elte.hu>2011-07-01 07:20:51 -0400
commit1ecc818c51b1f6886825dae3885792d5e49ec798 (patch)
tree2179ae53fa86ea6a42d01ff4efc1a3f6a32e76f2 /kernel
parent1c09ab0d257317f97e8629a3d0c8713d6dd9de4c (diff)
parentd902db1eb60387040fe541573083e47469db50ac (diff)
Merge branch 'sched/core-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing into sched/core
Diffstat (limited to 'kernel')
-rw-r--r--kernel/Kconfig.preempt3
-rw-r--r--kernel/sched.c6
2 files changed, 5 insertions, 4 deletions
diff --git a/kernel/Kconfig.preempt b/kernel/Kconfig.preempt
index bf987b95b356..24e7cb0ba26a 100644
--- a/kernel/Kconfig.preempt
+++ b/kernel/Kconfig.preempt
@@ -35,6 +35,7 @@ config PREEMPT_VOLUNTARY
35 35
36config PREEMPT 36config PREEMPT
37 bool "Preemptible Kernel (Low-Latency Desktop)" 37 bool "Preemptible Kernel (Low-Latency Desktop)"
38 select PREEMPT_COUNT
38 help 39 help
39 This option reduces the latency of the kernel by making 40 This option reduces the latency of the kernel by making
40 all kernel code (that is not executing in a critical section) 41 all kernel code (that is not executing in a critical section)
@@ -52,3 +53,5 @@ config PREEMPT
52 53
53endchoice 54endchoice
54 55
56config PREEMPT_COUNT
57 bool \ No newline at end of file
diff --git a/kernel/sched.c b/kernel/sched.c
index e355ee72e83f..4380a80c1e7a 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -2854,7 +2854,7 @@ void sched_fork(struct task_struct *p)
2854#if defined(CONFIG_SMP) 2854#if defined(CONFIG_SMP)
2855 p->on_cpu = 0; 2855 p->on_cpu = 0;
2856#endif 2856#endif
2857#ifdef CONFIG_PREEMPT 2857#ifdef CONFIG_PREEMPT_COUNT
2858 /* Want to start with kernel preemption disabled. */ 2858 /* Want to start with kernel preemption disabled. */
2859 task_thread_info(p)->preempt_count = 1; 2859 task_thread_info(p)->preempt_count = 1;
2860#endif 2860#endif
@@ -8022,7 +8022,7 @@ void __init sched_init(void)
8022 scheduler_running = 1; 8022 scheduler_running = 1;
8023} 8023}
8024 8024
8025#ifdef CONFIG_DEBUG_SPINLOCK_SLEEP 8025#ifdef CONFIG_DEBUG_ATOMIC_SLEEP
8026static inline int preempt_count_equals(int preempt_offset) 8026static inline int preempt_count_equals(int preempt_offset)
8027{ 8027{
8028 int nested = (preempt_count() & ~PREEMPT_ACTIVE) + rcu_preempt_depth(); 8028 int nested = (preempt_count() & ~PREEMPT_ACTIVE) + rcu_preempt_depth();
@@ -8032,7 +8032,6 @@ static inline int preempt_count_equals(int preempt_offset)
8032 8032
8033void __might_sleep(const char *file, int line, int preempt_offset) 8033void __might_sleep(const char *file, int line, int preempt_offset)
8034{ 8034{
8035#ifdef in_atomic
8036 static unsigned long prev_jiffy; /* ratelimiting */ 8035 static unsigned long prev_jiffy; /* ratelimiting */
8037 8036
8038 if ((preempt_count_equals(preempt_offset) && !irqs_disabled()) || 8037 if ((preempt_count_equals(preempt_offset) && !irqs_disabled()) ||
@@ -8054,7 +8053,6 @@ void __might_sleep(const char *file, int line, int preempt_offset)
8054 if (irqs_disabled()) 8053 if (irqs_disabled())
8055 print_irqtrace_events(current); 8054 print_irqtrace_events(current);
8056 dump_stack(); 8055 dump_stack();
8057#endif
8058} 8056}
8059EXPORT_SYMBOL(__might_sleep); 8057EXPORT_SYMBOL(__might_sleep);
8060#endif 8058#endif