hammer2 - Add vfs.hammer2.limit_dirty_inodes
authorMatthew Dillon <dillon@apollo.backplane.com>
Wed, 18 Apr 2018 06:10:02 +0000 (23:10 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Wed, 18 Apr 2018 06:14:52 +0000 (23:14 -0700)
commit33a2f82f253e9f9d6f9c4afd00d6bd71ac1526d0
tree154fcf1ceb881123b1c99f50c7b5925d13054be1
parent55a5a1ba587bcf642c0eb777e49521c6b2e69858
hammer2 - Add vfs.hammer2.limit_dirty_inodes

* Add vfs.hammer2.limit_dirty_inodes which causes hammer2 to
  immediately begin fsync()ing dirty inodes when the count exceeds
  the limit.  Set a reasonable limit.

* Fixes issues on slower storage when the syncer is unable to
  keep up with the userland frontend, causing the number of
  dirty inodes to increase almost unbounded (limited only by
  kern.maxvnodes).

  Allowing a large number of dirty inodes to accumulate can
  can result in a situation where the clean device buffer
  underpinning the dirty inode is discarded by the kernel before
  the filesystem is able to flush it, forcing additional disk reads
  and slowing things down even more.

* Improve the operation of speedup_syncer() by limiting the
  rate at which we call the function.  It is now called a maximum
  of approximately once per tick (each call speeding up a sync
  by one second).
sys/vfs/hammer2/hammer2.h
sys/vfs/hammer2/hammer2_ioctl.c
sys/vfs/hammer2/hammer2_vfsops.c
sys/vfs/hammer2/hammer2_vnops.c