[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080507175959.GZ19219@parisc-linux.org>
Date: Wed, 7 May 2008 11:59:59 -0600
From: Matthew Wilcox <matthew@....cx>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Ingo Molnar <mingo@...e.hu>, Andi Kleen <andi@...stfloor.org>,
"Zhang, Yanmin" <yanmin_zhang@...ux.intel.com>,
LKML <linux-kernel@...r.kernel.org>,
Alexander Viro <viro@....linux.org.uk>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: AIM7 40% regression with 2.6.26-rc1
On Wed, May 07, 2008 at 10:55:26AM -0700, Linus Torvalds wrote:
> Hmm. I do agree that _cond_resched() looks a bit iffy, although in a safe
> way. It uses just
>
> !(preempt_count() & PREEMPT_ACTIVE)
>
> to see whether it can schedule, and it should probably use in_atomic()
> which ignores the kernel lock.
>
> But right now, that whole thing is disabled if PREEMPT is on anyway, so in
> effect (with my test patch, at least) cond_preempt() would just be a no-op
> if PREEMPT is on, even if BKL isn't preemptable.
>
> So it doesn't look buggy, but it looks like it might cause longer
> latencies than strictly necessary. And if somebody depends on
> cond_resched() to avoid some bad livelock situation, that would obviously
> not work (but that sounds like a fundamental bug anyway, I really hope
> nobody has ever written their code that way).
Funny you should mention it; locks.c uses cond_resched() assuming that
it ignores the BKL. Not through needing to avoid livelock, but it does
presume that other higher priority tasks contending for the lock will
get a chance to take it. You'll notice the patch I posted yesterday
drops the file_lock_lock around the call to cond_resched().
--
Intel are signing my paycheques ... these opinions are still mine
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours. We can't possibly take such
a retrograde step."
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists