kernel - repurpose buffer cache entries under heavy I/O loads
authorMatthew Dillon <dillon@apollo.backplane.com>
Tue, 19 Jul 2016 01:27:12 +0000 (18:27 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sun, 24 Jul 2016 03:57:33 +0000 (20:57 -0700)
commitcd31df9f71c2673404f2ba89c447f0da9560e940
treed516d581a45d722fb0721983a72e623b4724d1ec
parente3eedc46fed7298f25e5bb5f0291ba17f90a6abe
kernel - repurpose buffer cache entries under heavy I/O loads

* At buffer-cache I/O loads > 200 MBytes/sec (newbuf instantiations, not
  cached buffer use), the buffer cache will now attempt to repurpose the
  VM pages in the buffer it is recycling instead of returning the pages
  to the VM system.

* sysctl vfs.repurposedspace may be used to adjust the I/O load limit.

* The repurposing code attempts to free the VM page then reassign it to
  the logical offset and vnode of the new buffer.  If this succeeds, the
  new buffer can be returned to the caller without having to run any
  SMP tlb operations.  If it fails, the pages will be either freed or
  returned to the VM system and the buffer cache will act as before.

* The I/O load limit has a secondary beneficial effect which is to reduce
  the allocation load on the VM system to something the pageout daemon can
  handle while still allowing new pages up to the I/O load limit to transfer
  to VM backing store.  Thus, this mechanism ONLY effects systems with I/O
  load limits above 200 MBytes/sec (or whatever programmed value you decide
  on).

* Pages already in the VM page cache do not count towards the I/O load limit
  when reconstituting a buffer.
sys/kern/vfs_bio.c
sys/platform/pc64/x86_64/machdep.c
sys/sys/buf.h
sys/vm/vm_page.c
sys/vm/vm_page.h