Date: Thu, 7 Jul 2016 20:31:36 +0000 (UTC) From: Warner Losh <imp@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302396 - head/sys/cam Message-ID: <201607072031.u67KVaZ9015864@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201607072031.u67KVaZ9015864>