kernel - VM rework part 20 - Fix vmmeter_neg_slop_cnt
authorMatthew Dillon <dillon@apollo.backplane.com>
Wed, 22 May 2019 07:16:17 +0000 (00:16 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Wed, 22 May 2019 07:22:31 +0000 (00:22 -0700)
commitfd1fd056dfaa9247c30cb8928bebaf32d2de3477
treeb4975805ad6469fc26ceadbca47030cc5e90cc7e
parentc9678a7ec9d5f155e1ac1c2f35e3932720940f37
kernel - VM rework part 20 - Fix vmmeter_neg_slop_cnt

* Fix some serious issues with the vmmeter_neg_slop_cnt calculation.
  The main problem is that this calculation was then causing
  vmstats.v_free_min to be recalculated to a much higher value
  than it should beeen calculated to, resulting in systems starting
  to page far earlier than they should.

  For example, the 128G TR started paging tmpfs data with 25GB of
  free memory, which was not intended.  The correct target for that
  amount of memory is more around 3GB.

* Remove vmmeter_neg_slop_cnt entirely and refactor the synchronization
  code to be smarter.  It will now synchronize vmstats fields whos
  adjustments exceed -1024, but only if paging would actually be
  needed in the worst-case scenario.

* This algorithm needs low-memory testing and might require more
  tuning.
sys/sys/vmmeter.h
sys/vm/vm_meter.c
sys/vm/vm_page.c
sys/vm/vm_page.h
sys/vm/vm_page2.h
sys/vm/vm_pageout.c