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

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 13 Dec 2000 20:43:30 +0900,
  Seigo Tanimura <tanimura> said:

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.

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

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

Seigo> Thus it should be even better to enter to and exit from the ufs hash
Seigo> mutex in the functions shown above.

The patch is at

http://people.FreeBSD.org/~tanimura/patches/ufsmtx.diff

where ufs_ihashlock() and ufs_ihashunlock() locks and releases the
hash table, respectively. It would be even better to make these
functions inlined, but we would then have to export ufs_ihash_mtx.

One question: in ufs/ffs/ffs_softdep.c:process_worklist_item(), is it
good to lock and release the hash table in the LIST_FOREACH loop to
traverse the worklist? Typically how many times does the loop iterate?

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