Date: Wed, 13 Dec 2000 11:10:09 -0800 From: Alfred Perlstein <bright@wintelcom.net> To: Matt Dillon <dillon@earth.backplane.com> Cc: tanimura@FreeBSD.ORG, cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG, jhb@FreeBSD.ORG, cp@FreeBSD.ORG Subject: Re: cvs commit: src/sys/ufs/ffs ffs_vfsops.c Message-ID: <20001213111008.H16205@fw.wintelcom.net> In-Reply-To: <200012131852.eBDIqm584821@earth.backplane.com>; from dillon@earth.backplane.com on Wed, Dec 13, 2000 at 10:52:48AM -0800 References: <200012131003.eBDA3rh34394@freefall.freebsd.org> <20001213024954.B16205@fw.wintelcom.net> <vm4s088s2l.wl@rina.r.dl.itc.u-tokyo.ac.jp> <200012131852.eBDIqm584821@earth.backplane.com>
next in thread | previous in thread | raw e-mail | index | archive | help
* Matt Dillon <dillon@earth.backplane.com> [001213 10:53] wrote: > :Thus it should be even better to enter to and exit from the ufs hash > :mutex in the functions shown above. > : > :Alfred> That maybe the code should be using wakeup_one() as well? I'm > :Alfred> not sure how wakeup_one works with respect to FIFO or LIFO, > :Alfred> if it's LIFO then this can cause problems because of lots of > :Alfred> processes wedged on this getting stuck behind the newcomers. > :Alfred> If it's FIFO we should be fine. > : > :A sleep queue is a TAILQ, which is FIFO. So wakeup_one() should work. > : > :-- > :Seigo Tanimura <tanimura@r.dl.itc.u-tokyo.ac.jp> <tanimura@FreeBSD.org> > > I have one request here. In order for wakeup_one() to work, any > waiting tasks *must* attempt to obtain the lock when they are woken up > rather then (potentially) abort and do something else, or no other > task will be woken up. > > I would like all instances where tasks wait here, or in the single > instance if we are talking about a centralized locking routine, to > document this requirement in a comment. > > We do not want to run up against the situation where some future > programmer believes he can wait for a lock and then abort when he > is woken up (e.g. if getting a signal) rather then actually obtain > the lock. This would not even be a problem if we just used a mutex instead of a mutex over a mutual exclusion lock. The mutex code should properly do a wakeup_one() internally. BSD/os is our reference implementation, but that doesn't mean they are correct 100% of the time. -- -Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org] "I have the heart of a child; I keep it in a jar on my desk." To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20001213111008.H16205>