summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2009-07-16 15:44:29 +0200
committerIngo Molnar <mingo@elte.hu>2009-07-18 15:51:41 +0200
commite09758fae8ccde97e026c704319eaa18d488dc86 (patch)
treeb2605cb49f9ac5a5d723cde13e14b5380ef9ed86
parent4b2155678d7cc7b5f45d6b36049091376c3408a2 (diff)
downloadlinux-3.10-e09758fae8ccde97e026c704319eaa18d488dc86.tar.gz
linux-3.10-e09758fae8ccde97e026c704319eaa18d488dc86.tar.bz2
linux-3.10-e09758fae8ccde97e026c704319eaa18d488dc86.zip
sched: Cover the CONFIG_DEBUG_SPINLOCK_SLEEP off-case for __might_sleep()
Cover the off case for __might_sleep(), so that we avoid #ifdefs in files that make use of it. Especially, this prepares for the __might_sleep() pull up on cond_resched(). Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> LKML-Reference: <1247725694-6082-3-git-send-email-fweisbec@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--include/linux/kernel.h1
-rw-r--r--kernel/sched.c3
2 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index d6320a3e8de..b804f694ae6 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -139,6 +139,7 @@ extern int _cond_resched(void);
# define might_sleep() \
do { __might_sleep(__FILE__, __LINE__); might_resched(); } while (0)
#else
+ static inline void __might_sleep(char *file, int line) { }
# define might_sleep() do { might_resched(); } while (0)
#endif
diff --git a/kernel/sched.c b/kernel/sched.c
index 4d39e96044b..370a6c31c5e 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -6610,9 +6610,8 @@ static inline int should_resched(void)
static void __cond_resched(void)
{
-#ifdef CONFIG_DEBUG_SPINLOCK_SLEEP
__might_sleep(__FILE__, __LINE__);
-#endif
+
add_preempt_count(PREEMPT_ACTIVE);
schedule();
sub_preempt_count(PREEMPT_ACTIVE);