From owner-svn-src-all@freebsd.org Tue Oct 24 02:25:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1327E37F5A; Tue, 24 Oct 2017 02:25:43 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7EF7D6B034; Tue, 24 Oct 2017 02:25:43 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9O2PgGH092045; Tue, 24 Oct 2017 02:25:42 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9O2PgnK092044; Tue, 24 Oct 2017 02:25:42 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710240225.v9O2PgnK092044@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 24 Oct 2017 02:25:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324944 - head/sys/cam X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam X-SVN-Commit-Revision: 324944 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Oct 2017 02:25:43 -0000 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;