xfs
[Top] [All Lists]

Re: PATCH: sleeping while holding a lock in _pagebuf_free_bh()::page_bu

To: Andi Kleen <ak@xxxxxxx>
Subject: Re: PATCH: sleeping while holding a lock in _pagebuf_free_bh()::page_buf.c
From: Luben Tuikov <luben@xxxxxxxxxxxx>
Date: Wed, 23 Oct 2002 00:15:36 -0400
Cc: Christoph Hellwig <hch@xxxxxxxxxxxxx>, linux-xfs <linux-xfs@xxxxxxxxxxx>, Eric Sandeen <sandeen@xxxxxxx>
Organization: Splentec Ltd.
References: <3DB49424.9E4CAC0F@xxxxxxxxxxxx> <20021022213140.A11191@xxxxxxxxxxxxx> <3DB5CC26.D5F4BB84@xxxxxxxxxxxx> <20021023051713.B17128@xxxxxxxxxxxxx>
Sender: linux-xfs-bounce@xxxxxxxxxxx
Andi Kleen wrote:
> 
> > BTW, what is the purpose of wake_up_sync()?
> 
> wake_up_sync() only wakes up the first process/thread waiting on the
> wait queue. Not all. This is to avoid the 'thundering herd' lock performance
> problem with many waiters when lots of processes get woken up all the time
> just to discover that there is no work for them yet and go to sleep again.
> But it needs careful auditing of the code if it can really tolerate
> wake one.

This was a rhetorical question...

From what I can see and read, wake_up() and wake_up_sync() both wake
up all non-exclusive sleepers and one exclusive sleeper.

The NON _sync versions, OTOH, will call reschedule_idle(), which _may_
cause (if the conditions are favourable) _another_ task to run
on _another_ CPU (SMP), _before_ the wake_up() returns.

This will cause a problem if that other task does IO on xfs
and the code is as it was several days ago.

-- 
Luben

P.S. This is more or less what had I explained when I was accused
of smoking...


<Prev in Thread] Current Thread [Next in Thread>