Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Dec 2000 20:43:30 +0900
From:      Seigo Tanimura <tanimura@r.dl.itc.u-tokyo.ac.jp>
To:        bright@wintelcom.net
Cc:        Seigo Tanimura <tanimura@r.dl.itc.u-tokyo.ac.jp>
Subject:   Re: cvs commit: src/sys/ufs/ffs ffs_vfsops.c
Message-ID:  <vm4s088s2l.wl@rina.r.dl.itc.u-tokyo.ac.jp>
In-Reply-To: In your message of "Wed, 13 Dec 2000 02:49:55 -0800" <20001213024954.B16205@fw.wintelcom.net>
References:  <200012131003.eBDA3rh34394@freefall.freebsd.org> <20001213024954.B16205@fw.wintelcom.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 13 Dec 2000 02:49:55 -0800,
  Alfred Perlstein <bright@wintelcom.net> said:

Alfred> * Seigo Tanimura <tanimura@FreeBSD.org> [001213 02:04] wrote:
>> tanimura    2000/12/13 02:03:53 PST
>> 
>> Modified files:
>> sys/ufs/ffs          ffs_vfsops.c 
>> Log:
>> Do not race for the lock of an inode hash.

Alfred> I don't understand why there just isn't a single mutex here.

Alfred> ffs_ihash_lock is really a mutex that depends on mutual exclusion
Alfred> of the pre-SMPng kernel to work properly.

Alfred> Why wasn't ffs_ihash_lock turned into a mutex and everything hinged
Alfred> off of that, instead of having a seperate lock over another lock
Alfred> that's just there for mutual exclusion.

If we are to reduce the number of locks, we should also kick away the
simplelock of the ufs hash table. Only the following functions call
the inode hash manipulation functions:

ufs/ffs/ffs_softdep.c:	process_worklist_item
ufs/ffs/ffs_vfsops.c:	ffs_vget (calls twice at most)
ufs/ufs/ufs_inode.c:	ufs_reclaim
ufs/ufs/ufs_vfsops.c:	ufs_init
ufs/ifs/ifs_vfsops.c:	ifs_vget (calls twice at most)

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>


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?vm4s088s2l.wl>