From owner-svn-src-head@freebsd.org Thu Jul 7 20:31:37 2016 Return-Path: Delivered-To: svn-src-head@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 180CEB75139; Thu, 7 Jul 2016 20:31:37 +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 E7C481F75; Thu, 7 Jul 2016 20:31:36 +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 u67KVaUM015865; Thu, 7 Jul 2016 20:31:36 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u67KVaZ9015864; Thu, 7 Jul 2016 20:31:36 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201607072031.u67KVaZ9015864@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 7 Jul 2016 20:31:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302396 - head/sys/cam X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jul 2016 20:31:37 -0000 Author: imp Date: Thu Jul 7 20:31:35 2016 New Revision: 302396 URL: https://svnweb.freebsd.org/changeset/base/302396 Log: Tidy up loose ends from Netflix I/O sched rename to dynamic I/O sched. Rename kern.cam.do_netflix_iosched sysctl to kern.cam.do_dynamic_iosched. Approved by: re (kib@) Modified: head/sys/cam/cam_iosched.c Modified: head/sys/cam/cam_iosched.c ============================================================================== --- head/sys/cam/cam_iosched.c Thu Jul 7 20:28:57 2016 (r302395) +++ head/sys/cam/cam_iosched.c Thu Jul 7 20:31:35 2016 (r302396) @@ -59,15 +59,19 @@ static MALLOC_DEFINE(M_CAMSCHED, "CAM I/ * Default I/O scheduler for FreeBSD. This implementation is just a thin-vineer * over the bioq_* interface, with notions of separate calls for normal I/O and * for trims. + * + * When CAM_IOSCHED_DYNAMIC is defined, the scheduler is enhanced to dynamically + * steer the rate of one type of traffic to help other types of traffic (eg + * limit writes when read latency deteriorates on SSDs). */ #ifdef CAM_IOSCHED_DYNAMIC -static int do_netflix_iosched = 1; -TUNABLE_INT("kern.cam.do_netflix_iosched", &do_netflix_iosched); -SYSCTL_INT(_kern_cam, OID_AUTO, do_netflix_iosched, CTLFLAG_RD, - &do_netflix_iosched, 1, - "Enable Netflix I/O scheduler optimizations."); +static int do_dynamic_iosched = 1; +TUNABLE_INT("kern.cam.do_dynamic_iosched", &do_dynamic_iosched); +SYSCTL_INT(_kern_cam, OID_AUTO, do_dynamic_iosched, CTLFLAG_RD, + &do_dynamic_iosched, 1, + "Enable Dynamic I/O scheduler optimizations."); static int alpha_bits = 9; TUNABLE_INT("kern.cam.iosched_alpha_bits", &alpha_bits); @@ -640,7 +644,7 @@ static inline int cam_iosched_has_io(struct cam_iosched_softc *isc) { #ifdef CAM_IOSCHED_DYNAMIC - if (do_netflix_iosched) { + if (do_dynamic_iosched) { struct bio *rbp = bioq_first(&isc->bio_queue); struct bio *wbp = bioq_first(&isc->write_queue); int can_write = wbp != NULL && @@ -954,7 +958,7 @@ cam_iosched_init(struct cam_iosched_soft bioq_init(&(*iscp)->bio_queue); bioq_init(&(*iscp)->trim_queue); #ifdef CAM_IOSCHED_DYNAMIC - if (do_netflix_iosched) { + if (do_dynamic_iosched) { bioq_init(&(*iscp)->write_queue); (*iscp)->read_bias = 100; (*iscp)->current_read_bias = 100; @@ -1019,7 +1023,7 @@ void cam_iosched_sysctl_init(struct cam_ "Sort IO queue to try and optimise disk access patterns"); #ifdef CAM_IOSCHED_DYNAMIC - if (!do_netflix_iosched) + if (!do_dynamic_iosched) return; isc->sysctl_tree = SYSCTL_ADD_NODE(&isc->sysctl_ctx, @@ -1061,7 +1065,7 @@ cam_iosched_flush(struct cam_iosched_sof bioq_flush(&isc->bio_queue, stp, err); bioq_flush(&isc->trim_queue, stp, err); #ifdef CAM_IOSCHED_DYNAMIC - if (do_netflix_iosched) + if (do_dynamic_iosched) bioq_flush(&isc->write_queue, stp, err); #endif } @@ -1206,7 +1210,7 @@ cam_iosched_next_bio(struct cam_iosched_ * See if we have any pending writes, and room in the queue for them, * and if so, those are next. */ - if (do_netflix_iosched) { + if (do_dynamic_iosched) { if ((bp = cam_iosched_get_write(isc)) != NULL) return bp; } @@ -1223,7 +1227,7 @@ cam_iosched_next_bio(struct cam_iosched_ * For the netflix scheduler, bio_queue is only for reads, so enforce * the limits here. Enforce only for reads. */ - if (do_netflix_iosched) { + if (do_dynamic_iosched) { if (bp->bio_cmd == BIO_READ && cam_iosched_limiter_iop(&isc->read_stats, bp) != 0) return NULL; @@ -1231,7 +1235,7 @@ cam_iosched_next_bio(struct cam_iosched_ #endif bioq_remove(&isc->bio_queue, bp); #ifdef CAM_IOSCHED_DYNAMIC - if (do_netflix_iosched) { + if (do_dynamic_iosched) { if (bp->bio_cmd == BIO_READ) { isc->read_stats.queued--; isc->read_stats.total++; @@ -1268,7 +1272,7 @@ cam_iosched_queue_work(struct cam_iosche #endif } #ifdef CAM_IOSCHED_DYNAMIC - else if (do_netflix_iosched && + else if (do_dynamic_iosched && (bp->bio_cmd == BIO_WRITE || bp->bio_cmd == BIO_FLUSH)) { if (cam_iosched_sort_queue(isc)) bioq_disksort(&isc->write_queue, bp); @@ -1332,7 +1336,7 @@ cam_iosched_bio_complete(struct cam_iosc { int retval = 0; #ifdef CAM_IOSCHED_DYNAMIC - if (!do_netflix_iosched) + if (!do_dynamic_iosched) return retval; if (iosched_debug > 10)