aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched/core.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2014-02-07 14:58:38 -0500
committerIngo Molnar <mingo@kernel.org>2014-02-22 12:07:50 -0500
commitdb273be2a7d42f92b3471e0f717982928214a650 (patch)
treee3ba291902e288f1fa43c6df9ceca6bf42b9f6f0 /kernel/sched/core.c
parent77177856e3bf39d435b3ae4bfd164ca3c8cd4577 (diff)
sched: Check for idle task in might_sleep()
Idle is not allowed to call sleeping functions ever! Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1391803122-4425-3-git-send-email-bigeasy@linutronix.de Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/sched/core.c')
-rw-r--r--kernel/sched/core.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 06da865043ec..a01fe6cfdb9b 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -6927,7 +6927,8 @@ void __might_sleep(const char *file, int line, int preempt_offset)
6927 static unsigned long prev_jiffy; /* ratelimiting */ 6927 static unsigned long prev_jiffy; /* ratelimiting */
6928 6928
6929 rcu_sleep_check(); /* WARN_ON_ONCE() by default, no rate limit reqd. */ 6929 rcu_sleep_check(); /* WARN_ON_ONCE() by default, no rate limit reqd. */
6930 if ((preempt_count_equals(preempt_offset) && !irqs_disabled()) || 6930 if ((preempt_count_equals(preempt_offset) && !irqs_disabled() &&
6931 !is_idle_task(current)) ||
6931 system_state != SYSTEM_RUNNING || oops_in_progress) 6932 system_state != SYSTEM_RUNNING || oops_in_progress)
6932 return; 6933 return;
6933 if (time_before(jiffies, prev_jiffy + HZ) && prev_jiffy) 6934 if (time_before(jiffies, prev_jiffy + HZ) && prev_jiffy)