cvs commit: src/sys/fs/pseudofs pseudofs_vncache.c

Alfred Perlstein alfred at freebsd.org
Mon Aug 16 00:33:15 PDT 2004


* Dag-Erling Smorgrav <des at 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 at mu.org cell: 408-480-4684


More information about the cvs-src mailing list