diff options
author | Peter Zijlstra <peterz@infradead.org> | 2016-09-20 22:34:51 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2016-09-30 11:03:29 +0200 |
commit | 9148a3a10e0b74c5722174a0bbef16d821f8a48b (patch) | |
tree | 7852c5c88abeccb66167da1c4dc4da8e4633be67 /kernel/sched/sched.h | |
parent | sched/core: Fix set_user_nice() (diff) | |
download | linux-9148a3a10e0b74c5722174a0bbef16d821f8a48b.tar.xz linux-9148a3a10e0b74c5722174a0bbef16d821f8a48b.zip |
sched/debug: Add SCHED_WARN_ON()
Provide SCHED_WARN_ON as wrapper for WARN_ON_ONCE() to avoid
CONFIG_SCHED_DEBUG wrappery.
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to '')
-rw-r--r-- | kernel/sched/sched.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index fc6ae04ec080..5489d07a4643 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -15,6 +15,12 @@ #include "cpudeadline.h" #include "cpuacct.h" +#ifdef CONFIG_SCHED_DEBUG +#define SCHED_WARN_ON(x) WARN_ONCE(x, #x) +#else +#define SCHED_WARN_ON(x) ((void)(x)) +#endif + struct rq; struct cpuidle_state; @@ -1309,7 +1315,7 @@ static inline void idle_set_state(struct rq *rq, static inline struct cpuidle_state *idle_get_state(struct rq *rq) { - WARN_ON(!rcu_read_lock_held()); + SCHED_WARN_ON(!rcu_read_lock_held()); return rq->idle_state; } #else |