kernel - Refactor vnode_free_list, vnode reuse algorithm
commit04bd6171a2376758dca089a0ac0148432e60ebfc
authorMatthew Dillon <dillon@apollo.backplane.com>
Mon, 22 Feb 2010 15:40:05 +0000 (22 07:40 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Mon, 22 Feb 2010 15:40:05 +0000 (22 07:40 -0800)
treec8082c53aab6ca6fd17815203f8f7746b0de4707
parentaabd5ce88e10cfe2005dedc5da2071731329e39d
kernel - Refactor vnode_free_list, vnode reuse algorithm

* Rip out most of he VAGEx stuff.  It might come back in another form
  later.

* Split the vnode_free_list into three parts, separated by two markers
  (vnode_free_mid1 and vnode_free_mid2).

* Insert vnodes on the free list based on the following.  New vnodes
  are allocated from the base of the list.

  At the HEAD - If the vnode is VRECLAIMED (i.e. dead)
  end of first section - If the vnode has no cached VM or SWAP data
  end of second section - If the vnode has cached SWAP data and no cached VM
  at the TAIL - If the vnode has cached VM data

* Implement a rover to slowly scan vnodes in the list when allocating
  and shift them to the appropriate section.  This fixes a degenerate
  condition in the placement of the markers.

* A Vnode is removed and usually immediately reinserted whenever it
  is accesesd by userland but not held open, giving us a LRU-like
  algorithm within each section of the list but non-LRU-like transits
  between sections of the list.

  Transits between sections are determined more by how the VM system
  recycles related VM cache pages.  Cached SWAP data only occurs if
  the swapcache is turned on.

* Future: Might use VAGE to implement a second go-around in the queue
  or a burst re-placement in the queue when the data set is found to
  be too big to fit.
sys/kern/vfs_lock.c