kernel - adjust vnode reclamation
authorMatthew Dillon <dillon@apollo.backplane.com>
Fri, 1 Jan 2010 03:25:25 +0000 (19:25 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Fri, 1 Jan 2010 03:25:25 +0000 (19:25 -0800)
* Do a pre-check for auxillary refs and do not reclaim a vnode through
  standard recyclement if auxillary refs are present.

  Recyclement can still occur under other circumstances.  Auxillary
  refs nominally just prevent the vnode from being completely destroyed
  or reused.

  This is a bit experimental.

sys/kern/vfs_lock.c

index 2731b54..419f4bf 100644 (file)
@@ -607,6 +607,16 @@ allocfreevnode(void)
                if ((ulong)vp == trackvnode)
                        kprintf("allocfreevnode %p %08x\n", vp, vp->v_flag);
 #endif
+               /*
+                * Do not reclaim a vnode with auxillary refs.  This includes
+                * namecache refs due to a related ncp being locked or having
+                * children.
+                */
+               if (vp->v_auxrefs) {
+                       __vfreetail(vp);
+                       vx_unlock(vp);
+                       continue;
+               }
 
                /*
                 * With the vnode locked we can safely remove it