Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 02 May 1997 12:43:41 +0200
From:      Poul-Henning Kamp <phk@dk.tfs.com>
To:        Doug Rabson <dfr@nlsystems.com>
Cc:        Poul-Henning Kamp <phk@dk.tfs.com>, current@freebsd.org
Subject:   Re: vnode->v_usage 
Message-ID:  <5321.862569821@critter>
In-Reply-To: Your message of "Fri, 02 May 1997 11:04:33 BST." <Pine.BSF.3.95q.970502105721.331D-100000@herring.nlsystems.com> 

next in thread | previous in thread | raw e-mail | index | archive | help

>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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5321.862569821>