Skip to content

Commit

Permalink
Make 'cond_resched()' nullification depend on PREEMPT_BKL
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Linus Torvalds committed May 12, 2008
1 parent 542dafa commit c714a53
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/linux/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -2038,7 +2038,7 @@ static inline int need_resched(void)
* cond_resched_softirq() will enable bhs before scheduling.
*/
extern int _cond_resched(void);
#ifdef CONFIG_PREEMPT
#ifdef CONFIG_PREEMPT_BKL
static inline int cond_resched(void)
{
return 0;
Expand Down

0 comments on commit c714a53

Please sign in to comment.