Fix a number of core kernel issues related to HAMMER operation.
authorMatthew Dillon <dillon@dragonflybsd.org>
Sun, 18 May 2008 05:54:31 +0000 (05:54 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Sun, 18 May 2008 05:54:31 +0000 (05:54 +0000)
commit2ec4b00d38cf6ed7cf61efde0392ff0d3b26c787
tree6c4b7d1c77a8ce189724d922b42257498ee87a43
parent7fbd95bcf27c686a31c337ec5e22462a1e23df8a
Fix a number of core kernel issues related to HAMMER operation.

* The cluster code was incorrectly using the maximum IO size from
  the filesystem on which /dev is mounted instead of the maximum
  IO size of the block device.  This became evident when HAMMER
  (with 16K blocks) tried to call cluster_read() via /dev/ad6s1h
  (on UFS with 8K blocks).

* Change the way the VNLRU code works to avoid an infinite loop in
  vmntvnodescan().  The vnode LRU recycling code was cycling vnodes
  from the head of mp->mnt_nvnodelist to the tail.  Under certain heavy
  load conditions this could cause a vmntvnodescan() to never finish
  running and eventually hit a count assertion (at 1,000,000 vnodes scanned).

  Instead of cycling the vnodes in the mnt_nvnodelist, use the syncer
  vnode (mount->mnt_syncer) as a placemarker and move *IT* within the
  list to represent the LRU scan.  By not cycling vnodes to the end
  of the list, vmntvnodescan() can no longer get into an infinite loop.

* Change the mount->mnt_syncer logic slightly to avoid races against
  a background sync while unmounting.  The field is no longer cleared
  by the sync_reclaim() call but is instead cleared by the unmount code
  before vrele()ing the special vnode.
sys/kern/vfs_cluster.c
sys/kern/vfs_mount.c
sys/kern/vfs_subr.c
sys/kern/vfs_sync.c
sys/kern/vfs_syscalls.c
sys/sys/vnode.h
sys/vfs/msdosfs/msdosfs_vfsops.c