Re: AIM7 40% regression with 2.6.26-rc1

From: Ingo Molnar
Date: Wed May 07 2008 - 14:49:58 EST



* Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:

> .. Hmm ... Time passes. Linus looks at git history.
>
> It does look like "cond_resched()" has not worked with the BKL since
> 2005, and hasn't taken the BKL into account. Commit 5bbcfd9000:
>
> [PATCH] cond_resched(): fix bogus might_sleep() warning
>
> + if (unlikely(preempt_count()))
> + return;
>
> which talks about the BKS, ie it only took the *semaphore*
> implementation into account. Never the spinlock-with-preemption-count
> one.
>
> Or am I blind?

hm, i think you are right.

most latency reduction was concentrated on the PREEMPT+PREEMPT_BKL case,
and not getting proper cond_resched() behavior in case of !PREEMPT_BKL
would certainly not be noticed by distros or users.

We made CONFIG_PREEMPT_BKL=y the default on SMP in v2.6.8, in this
post-2.6.7 commit that introduced the feature:

| commit fb8f6499abc6a847109d9602b797aa6afd2d5a3d
| Author: Ingo Molnar <mingo@xxxxxxx>
| Date: Fri Jan 7 21:59:57 2005 -0800
|
| [PATCH] remove the BKL by turning it into a semaphore

There was constant trouble around all these variations of preemptability
and their combination with debugging helpers. (So i was rather happy to
get rid of !PREEMPT_BKL - in the (apparently wrong) assumption that no
tears will be shed.)

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/