svn commit: r324944 - head/sys/cam
Warner Losh
imp at FreeBSD.org
Tue Oct 24 02:25:43 UTC 2017
Author: imp
Date: Tue Oct 24 02:25:42 2017
New Revision: 324944
URL: https://svnweb.freebsd.org/changeset/base/324944
Log:
Treat a 'current' value of 0 as unlimited as a failsfe.
When limiting I/O, a value of 0 makes no sense as a limit. No progress
can be made. Trade the possibility that someone might be doing
something clever to achieve ultra-low I/O limits vs the damage of not
ever making progress on an I/O in favor of making progress. Now the
machine won't be useless if this accidentally gets requested.
Sponsored by: Netflix
Modified:
head/sys/cam/cam_iosched.c
Modified: head/sys/cam/cam_iosched.c
==============================================================================
--- head/sys/cam/cam_iosched.c Tue Oct 24 00:51:11 2017 (r324943)
+++ head/sys/cam/cam_iosched.c Tue Oct 24 02:25:42 2017 (r324944)
@@ -457,9 +457,10 @@ cam_iosched_iops_caniop(struct iop_stats *ios, struct
/*
* So if we have any more IOPs left, allow it,
- * otherwise wait.
+ * otherwise wait. If current iops is 0, treat that
+ * as unlimited as a failsafe.
*/
- if (ios->l_value1 <= 0)
+ if (ios->current > 0 && ios->l_value1 <= 0)
return EAGAIN;
return 0;
}
@@ -525,8 +526,11 @@ cam_iosched_bw_caniop(struct iop_stats *ios, struct bi
* what we let through this quantum (to prevent the
* starvation), at the cost of getting a little less
* next quantum.
+ *
+ * Also note that if the current limit is <= 0,
+ * we treat it as unlimited as a failsafe.
*/
- if (ios->l_value1 <= 0)
+ if (ios->current > 0 && ios->l_value1 <= 0)
return EAGAIN;
More information about the svn-src-all
mailing list