From owner-cvs-all Wed Dec 13 22:34:32 2000 From owner-cvs-all@FreeBSD.ORG Wed Dec 13 22:34:28 2000 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from rina.r.dl.itc.u-tokyo.ac.jp (rina.r.dl.itc.u-tokyo.ac.jp [133.11.199.247]) by hub.freebsd.org (Postfix) with ESMTP id 71F7737B400; Wed, 13 Dec 2000 22:34:27 -0800 (PST) Received: from rina.r.dl.itc.u-tokyo.ac.jp (localhost [127.0.0.1]) by rina.r.dl.itc.u-tokyo.ac.jp (8.11.1+3.4Wpre/3.7W-rina.r-0.1-11.01.2000) with ESMTP id eBE6YKC82938; Thu, 14 Dec 2000 15:34:22 +0900 (JST) Date: Thu, 14 Dec 2000 15:34:20 +0900 Message-ID: From: Seigo Tanimura 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 In-Reply-To: In your message of "Wed, 13 Dec 2000 20:43:30 +0900" References: <200012131003.eBDA3rh34394@freefall.freebsd.org> <20001213024954.B16205@fw.wintelcom.net> User-Agent: Wanderlust/1.1.1 (Purple Rain) SEMI/1.13.7 (Awazu) FLIM/1.13.2 (Kasanui) MULE XEmacs/21.1 (patch 12) (Channel Islands) (i386--freebsd) Organization: Digital Library Research Division, Information Techinology Centre, The University of Tokyo MIME-Version: 1.0 (generated by SEMI 1.13.7 - "Awazu") Content-Type: text/plain; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Wed, 13 Dec 2000 20:43:30 +0900, Seigo 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 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message