sched: Cover the CONFIG_DEBUG_SPINLOCK_SLEEP off-case for __might_sleep()
authorFrederic Weisbecker <fweisbec@gmail.com>
Thu, 16 Jul 2009 13:44:29 +0000 (15:44 +0200)
committerIngo Molnar <mingo@elte.hu>
Sat, 18 Jul 2009 13:51:41 +0000 (15:51 +0200)
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>
include/linux/kernel.h
kernel/sched.c

index d6320a3e8def0fc22a9595d8ff03f52c08983404..b804f694ae6a7691ea62f2d8c8fbbfff17ebb857 100644 (file)
@@ -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
 
index 4d39e96044b9d07aaacb02c1740abc6a3ac06401..370a6c31c5e11354079150cd9681c19eb36ca0cd 100644 (file)
@@ -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);