KERNEL - Implement a poor man's ioscheduler using sys/iosched.h
commit79eae878f1b8b6e2cb926de5b30091ae33d25ea7
authorMatthew Dillon <dillon@apollo.backplane.com>
Fri, 11 Sep 2009 02:12:08 +0000 (10 19:12 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Fri, 11 Sep 2009 02:12:08 +0000 (10 19:12 -0700)
tree08ae76f067fdb6da29dce221bb55f34481c35765
parentccf6a64d267d3f8776eb51a2d7ae3da363a6d22e
KERNEL - Implement a poor man's ioscheduler using sys/iosched.h

* Move struct iosched_data from the LWP to the TD.

* Expand bd_wait()'s wakeup array from 128 entries to 16384 entries
  to cover a larger portion of the buffer cache's dirty space.

* bwillwrite() now adds to iosched_data->iowbytes and the ticks
  global is used to decay it.

  Total iowbytes is kept in per-cpu structures.  Each cpu does not
  necessarily match the threads assigned to it, but in aggregate
  the sum of iowbytes for all cpus will match the sum of iowbytes
  for all threads in the system.

* bwillwrite() now calculates a relative I/O write load for each thread
  in the system and passes a fractional calculation to bd_wait().

  This causes processes with low I/O loads to have a higher priority
  (as in, NOT stall in bd_wait() anywhere near as long), and processes
  with high I/O loads to have a lower priority (stall longer in bd_wait()),
  when the buffer cache is saturated with dirty data.
sys/kern/kern_exit.c
sys/kern/kern_iosched.c
sys/kern/lwkt_thread.c
sys/kern/vfs_bio.c
sys/sys/iosched.h
sys/sys/proc.h
sys/sys/thread.h