tmpfs - Fix periodic syncer cpu-bound stalls w/tmpfs on big-mem boxes
authorMatthew Dillon <dillon@apollo.backplane.com>
Tue, 15 Jan 2019 22:17:26 +0000 (14:17 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Tue, 15 Jan 2019 22:17:26 +0000 (14:17 -0800)
commitd883c473b2887a2c27549ef36e8a20c3e8ed71fd
treed40ef23413dae17e5fec15506a622f9c52281663
parent86ab4538d2b6fee9d8367b12f6438d81ca6002b5
tmpfs - Fix periodic syncer cpu-bound stalls w/tmpfs on big-mem boxes

* A bug in tmpfs leaves dirty tmpfs vnodes (which is basically all
  of them) on the syncer list, causing the syncer to scan the entire
  list every few seconds.  When a large number of vnodes are involved,
  this can lead to noticable cpu-bound stalls on the cpu the syncer is
  running on.

* Generally speaking this should significantly improve applications
  which use tmpfs a lot, such as synth runs, but was probably not noticed
  on machines with less than 32GB of ram due to the lower kern.maxvnodes
  default.

* Solved by unconditionally removing the vnode from the syncer list
  in tmpfs_fsync(), but otherwise leaving the vnode marked VISDIRTY and
  usually also VOBJDIRTY.  Tmpfs's reclaim code properly handles the
  disconnect regardless of the syncer state of the vnode.

  Removing the vnode ensures that only one syncer pass is performed on
  it, instead of repeated passes every few seconds.
sys/vfs/tmpfs/tmpfs_vnops.c