From owner-freebsd-current Fri May 2 03:45:02 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id DAA24645 for current-outgoing; Fri, 2 May 1997 03:45:02 -0700 (PDT) Received: from critter.dk.tfs.com (phk.cybercity.dk [195.8.129.17]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id DAA24631; Fri, 2 May 1997 03:44:55 -0700 (PDT) Received: from critter (localhost [127.0.0.1]) by critter.dk.tfs.com (8.8.5/8.8.5) with ESMTP id MAA05323; Fri, 2 May 1997 12:43:42 +0200 (CEST) To: Doug Rabson cc: Poul-Henning Kamp , current@freebsd.org From: Poul-Henning Kamp Subject: Re: vnode->v_usage In-reply-to: Your message of "Fri, 02 May 1997 11:04:33 BST." Date: Fri, 02 May 1997 12:43:41 +0200 Message-ID: <5321.862569821@critter> Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >I don't have any performance numbers but it seems to work fine. I think >the cache should just call vtouch for all vnodes and not check the usage >count. OK. >Also vtouch should take the v_interlock simple_lock before reading >the v_usecount field as specified by vnode.h. Ok, now I'm in doubt here... Which of these two places are the correct place to release the interlock, I've marked the candidates with XXX, I pressume the later, right ? void vtouch(vp) struct vnode *vp; { simple_lock(&vp->v_interlock); if (vp->v_usecount) { simple_unlock(&vp->v_interlock); return; } simple_unlock(&vp->v_interlock); /* XXX */ simple_lock(&vnode_free_list_slock); TAILQ_REMOVE(&vnode_free_list, vp, v_freelist); TAILQ_INSERT_TAIL(&vnode_free_list, vp, v_freelist); simple_unlock(&vnode_free_list_slock); simple_unlock(&vp->v_interlock); /* XXX */ } -- Poul-Henning Kamp | phk@FreeBSD.ORG FreeBSD Core-team. http://www.freebsd.org/~phk | phk@login.dknet.dk Private mailbox. whois: [PHK] | phk@tfs.com TRW Financial Systems, Inc. Power and ignorance is a disgusting cocktail.