From owner-cvs-all Wed Dec 13 3:43:40 2000 From owner-cvs-all@FreeBSD.ORG Wed Dec 13 03:43:36 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 BF9E437B400; Wed, 13 Dec 2000 03:43:35 -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 eBDBhUC62627; Wed, 13 Dec 2000 20:43:32 +0900 (JST) Date: Wed, 13 Dec 2000 20:43:30 +0900 Message-ID: From: Seigo Tanimura To: bright@wintelcom.net 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 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> Cc: Seigo Tanimura 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 02:49:55 -0800, Alfred Perlstein said: Alfred> * Seigo Tanimura [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 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message