On Thu, May 08, 2008 at 05:10:28PM +0200, Ingo Molnar wrote:This might be the problem that causes the missing wakeups. If you have a semaphore with n=2, and four processes calling down(), tasks A and B acquire the semaphore and tasks C and D go to sleep. Task A calls up() and wakes up C. Then task B calls up() and doesn't wake up anyone because C hasn't run yet. I think we need another wakeup when task C finishes in __down_common, like this (on top of your patch): diff --git a/kernel/semaphore.c b/kernel/semaphore.c index 5e41217..e520ad4 100644 --- a/kernel/semaphore.c +++ b/kernel/semaphore.c @@ -229,6 +229,11 @@ static inline int __sched __down_common(struct semaphore *sem, long state, } list_del(&waiter.list); + + /* It's possible we need to wake up the next task on the list too */ + if (unlikely(sem->count > 1) && !list_empty(&sem->wait_list)) + __up(sem); + return ret; } Sven, can you try this with your workload? I suspect this might be it because XFS does use semaphores with n>1. -- 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." --
| Andrew Morton | -mm merge plans for 2.6.23 |
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
| Greg KH | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Tomasz Kłoczko | Is it time for remove (crap) ALSA from kernel tree ? |
git: | |
| David Miller | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| David Miller | [GIT]: Networking |
| Paweł Staszewski | iproute2 action/policer question |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
