Re: file locks: Use wait_event_interruptible_timeout()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jan 15, 2008 at 08:04:47AM -0700, Matthew Wilcox wrote:
> On Tue, Jan 15, 2008 at 09:48:51AM -0500, J. Bruce Fields wrote:
> > On Mon, Jan 14, 2008 at 09:28:30PM -0700, Matthew Wilcox wrote:
> > > interruptible_sleep_on_locked() is just an open-coded
> > > wait_event_interruptible_timeout() with a few assumptions since we know
> > > we hold the BKL.  locks_block_on_timeout() is only used in one place, so
> > > it's actually simpler to inline it into its caller.
> > 
> > Makes sense, thanks.  So the assumption we were depending on the BKL for
> > was that we could count on the wake-up not coming till after we block,
> > so we could skip a check ->fl_next that's normally needed to resolve the
> > usual sleeping-on-some-condition race?
> 
> That's right.

OK, thanks, applied just with the "few assumptions" replaced by a
description of that particular problem:

	"interruptible_sleep_on_locked() is just an open-coded
	wait_event_interruptible_timeout(), with the one difference that
	interruptible_sleep_on_locked() doesn't bother to check the
	condition on which it waits, depending instead on the BKL to
	avoid the case where it blocks after the wakeup has already been
	called.

	locks_block_on_timeout() is only used in one place, so it's
	actually simpler to inline it into its caller."

Pending locks patches available from:

	git://linux-nfs.org/~bfields/linux.git locks


--b.
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux