kernel - Add TPS balancing mode to scsi_da (da* disks)
authorMatthew Dillon <dillon@apollo.backplane.com>
Fri, 28 Jun 2019 04:58:49 +0000 (21:58 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Fri, 28 Jun 2019 05:47:42 +0000 (22:47 -0700)
commit128500e6d25d576f0c76a9025e31997c30c3ed7b
treea3e8a6c7b1d69240f5bec81fc31b0195463f424e
parent30fe692f14000c47bce6908c249ea6d4c0fd1a07
kernel - Add TPS balancing mode to scsi_da (da* disks)

* This feature brings write tps down to match read tps when both are
  pending.  Normally both read and write I/Os get at least a few tags,
  but because write I/O is buffered by devices, even giving it one tag
  can complete destroy read performance.

  To accomplish this the feature monitors approximate TPS using a counter
  with exponential decay and will temporarily sets write openings in the
  device queue to zero.

* SSDs usually do a better job on their own, but this feature won't hurt
  so we do not distinguish between HDDs and SSDs.

* New sysctls for this feature (feature is enabled by default):

  kern.cam.da.balance_enable 1 (0=disable, 1=enable)
  kern.cam.da.balance_ratio 100 (read:write ratio, 1:1 is 100)
  kern.cam.da.balance_debug 0 (log to console each second)

  You can adjust the read:write tps ratio as desired.  For example,
  the value 200 will adjust the ratio to 2:1.
sys/bus/cam/scsi/scsi_da.c