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>
Fri, 22 Jul 2016 05:55:15 +0000 (22:55 -0700)
commit962f16a7bf52208573e87485f9d477e652bb34bf
tree86b353e35798d057e4f9e81f297595decebca5d2
parentdc6a6bd20a36f4a0f9c2ef312218563c537660ca
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