svn commit: r323511 - head/sys/cam

Warner Losh imp at FreeBSD.org
Tue Sep 12 23:46:34 UTC 2017


Author: imp
Date: Tue Sep 12 23:46:33 2017
New Revision: 323511
URL: https://svnweb.freebsd.org/changeset/base/323511

Log:
  cam iosched: Limit the quanta default to hz if it's below 200
  
  The cam_iosched_ticker() can't be scheduled more than once per tick.
  Some limiters depend on quanta matching the number of calls per second
  to enforce the proper limits. Limit the quanta to no faster than 1 per
  clock tick. This fixes some features when running in VMs where the
  default HZ is 100.
  
  PR: 221953
  Obtained from: ElectroBSD
  Differential Revision: https://reviews.freebsd.org/D12337
  Submitted by: Fabian Keil

Modified:
  head/sys/cam/cam_iosched.c

Modified: head/sys/cam/cam_iosched.c
==============================================================================
--- head/sys/cam/cam_iosched.c	Tue Sep 12 23:42:52 2017	(r323510)
+++ head/sys/cam/cam_iosched.c	Tue Sep 12 23:46:33 2017	(r323511)
@@ -1022,7 +1022,7 @@ cam_iosched_init(struct cam_iosched_softc **iscp, stru
 		bioq_init(&(*iscp)->write_queue);
 		(*iscp)->read_bias = 100;
 		(*iscp)->current_read_bias = 100;
-		(*iscp)->quanta = 200;
+		(*iscp)->quanta = min(hz, 200);
 		cam_iosched_iop_stats_init(*iscp, &(*iscp)->read_stats);
 		cam_iosched_iop_stats_init(*iscp, &(*iscp)->write_stats);
 		cam_iosched_iop_stats_init(*iscp, &(*iscp)->trim_stats);


More information about the svn-src-head mailing list