[lkml]   [2008]   [Jun]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subjectlmbench regression due to cond_resched nullification change 26-rc5 vs. 25
Hello Linus,

On a 6-way s390 I have seen some interesting regression in 2.6.26-rc5 vs.
2.6.25 for the lmbench benchmark.

For example select file 500:
23 microseconds
32 microseconds

Several lmbench tests show a regression but I only bisected the select test
case so far:

commit c714a534d85576af21b06be605ca55cb2fb887ee
Author: Linus Torvalds <>
Date: Mon May 12 13:34:13 2008 -0700

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 <>

diff --git a/include/linux/sched.h b/include/linux/sched.h
index 5a63f2d..5395a61 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -2038,7 +2038,7 @@ static inline int need_resched(void)
* cond_resched_softirq() will enable bhs before scheduling.
extern int _cond_resched(void);
static inline int cond_resched(void)
return 0;
Reverting that patch gives me the 2.6.25 performance.

I think the patch is fine from the correctness point of view (do resched
inside BKL protected zones if its safe) but I dont understand why it has a
large impact on the select microbenchmark. Any ideas? Is it simply the
overhead of _cond_resched?


 \ /
  Last update: 2008-06-20 10:17    [W:0.045 / U:1.420 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site