Skip to content

Commit c714a53

Browse files
committed
Make 'cond_resched()' nullification depend on PREEMPT_BKL
Because it's not correct with a non-preemptable BKL and just causes PREEMPT kernels to have longer latencies than non-PREEMPT ones (which is obviously not the point of it at all). Of course, that config option actually got removed as an option earlier, so for now this basically disables it entirely, but if BKL preemption is ever resurrected it will be a meaningful optimization. And in the meantime, it at least documents the intent of the code, while not doing the wrong thing. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 542dafa commit c714a53

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/linux/sched.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2038,7 +2038,7 @@ static inline int need_resched(void)
20382038
* cond_resched_softirq() will enable bhs before scheduling.
20392039
*/
20402040
extern int _cond_resched(void);
2041-
#ifdef CONFIG_PREEMPT
2041+
#ifdef CONFIG_PREEMPT_BKL
20422042
static inline int cond_resched(void)
20432043
{
20442044
return 0;

0 commit comments

Comments
 (0)