Date: Mon, 16 Aug 2004 00:33:14 -0700 From: Alfred Perlstein <alfred@freebsd.org> To: Dag-Erling Smorgrav <des@FreeBSD.org> Cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/fs/pseudofs pseudofs_vncache.c Message-ID: <20040816073314.GA57908@elvis.mu.org> In-Reply-To: <200408152158.i7FLw2mW016740@repoman.freebsd.org> References: <200408152158.i7FLw2mW016740@repoman.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
* Dag-Erling Smorgrav <des@FreeBSD.org> [040815 14:58] wrote:
> des 2004-08-15 21:58:02 UTC
>
> FreeBSD src repository
>
> Modified files:
> sys/fs/pseudofs pseudofs_vncache.c
> Log:
> Release the vnode cache mutex when calling vgone(), since vgone() may
> sleep. This makes pfs_exit() even less efficient than before, but on
> the bright side, the vnode cache mutex no longer needs to be recursive.
I would suggest moving them all to a seperate list, then walking that
list calling vgone on each node.
here's some... psuedo-code!
--- pseudofs_vncache.c 15 Aug 2004 21:58:02 -0000 1.26
+++ pseudofs_vncache.c 16 Aug 2004 07:34:51 -0000
@@ -219,9 +219,10 @@
static void
pfs_exit(void *arg, struct proc *p)
{
struct pfs_vdata *pvd, *pvfree;
struct vnode *vnp;
pvfree = NULL;
mtx_lock(&Giant);
/*
* This is extremely inefficient due to the fact that vgone() not
@@ -240,16 +241,14 @@
pvd = pfs_vncache;
while (pvd != NULL) {
if (pvd->pvd_pid == p->p_pid) {
/* REMOVE FROM pfs_vncache */
/* ADD TO pvfree */
} else {
pvd = pvd->pvd_next;
}
}
mtx_unlock(&pfs_vncache_mutex);
/* while ! end of list pvfree vgone pvfree->v_data */
mtx_unlock(&Giant);
}
--
- Alfred Perlstein
- Research Engineering Development Inc.
- email: bright@mu.org cell: 408-480-4684
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040816073314.GA57908>
