Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Frederic Weisbecker and committed by
Ingo Molnar
e09758fa 4b215567

+2 -2
+1
include/linux/kernel.h
··· 139 139 # define might_sleep() \ 140 140 do { __might_sleep(__FILE__, __LINE__); might_resched(); } while (0) 141 141 #else 142 + static inline void __might_sleep(char *file, int line) { } 142 143 # define might_sleep() do { might_resched(); } while (0) 143 144 #endif 144 145
+1 -2
kernel/sched.c
··· 6610 6610 6611 6611 static void __cond_resched(void) 6612 6612 { 6613 - #ifdef CONFIG_DEBUG_SPINLOCK_SLEEP 6614 6613 __might_sleep(__FILE__, __LINE__); 6615 - #endif 6614 + 6616 6615 add_preempt_count(PREEMPT_ACTIVE); 6617 6616 schedule(); 6618 6617 sub_preempt_count(PREEMPT_ACTIVE);