On Wed, 7 May 2008, Matthew Wilcox wrote:Well, this would only be noticeable with CONFIG_PREEMPT. If you don't have preempt enabled, it looks like everything should work ok: the kernel lock wouldn't increase the preempt count, and _cond_resched() works fine. If you're PREEMPT, then the kernel lock would increase the preempt count, and _cond_resched() would refuse to re-schedule it, *but* with PREEMPT you'd never see it *anyway*, because PREEMPT will disable cond_resched() entirely (because preemption takes care of normal scheduling latencies without it). And I'm also sure that this all worked fine at some point, and it's largely a result just of the multiple different variations of BKL preemption coupled with some of them getting removed entirely, so the code that used to handle it just got corrupt over time. See commit 02b67cc3b, for example. .. 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? Linus --
| Al Boldi | Re: [ck] Re: [ANNOUNCE] RSDL completely fair starvation free interactive cpu sched... |
| Ingo Molnar | Re: [patch] sched_clock(): cleanups |
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
| Amit K. Arora | [RFC] Heads up on sys_fallocate() |
git: | |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| David Miller | [GIT]: Networking |
| Gerrit Renker | [PATCH 18/37] dccp: Support for Mandatory options |
| Denys Vlasenko | [PATCH 1/2] bnx2: factor out gzip unpacker |
