xfs
[Top] [All Lists]

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

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: PATCH: sleeping while holding a lock in _pagebuf_free_bh()::page_buf.c
From: Andi Kleen <ak@xxxxxxx>
Date: Wed, 23 Oct 2002 05:15:17 +0200
Cc: Luben Tuikov <luben@xxxxxxxxxxxx>, linux-xfs <linux-xfs@xxxxxxxxxxx>, Eric Sandeen <sandeen@xxxxxxx>
In-reply-to: <20021022213140.A11191@infradead.org>
References: <3DB49424.9E4CAC0F@splentec.com> <20021022213140.A11191@infradead.org>
Sender: linux-xfs-bounce@xxxxxxxxxxx
User-agent: Mutt/1.3.22.1i
On Tue, Oct 22, 2002 at 09:31:40PM +0100, Christoph Hellwig wrote:
> Bug is real, fix is wrong.  The right fix for this issue is to
> move the wake_up outside the lock, like below.  I'll commit
> this patch together with a few related changes tmorrow when
> I'm back in the office.

Are you sure? IMHO neither wake_up() nor wake_up_sync() should sleep.
And they don't in neither O(1) nor the old scheduler.
Also there are no lock ordering issues I can see.
So in theory it should be fine to call wake_up() with the lock held.

In fact I think you even need the lock to avoid lost wakeups.

-Andi
> 


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