Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Nov 2018 22:50:30 +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: r341003 - head/sys/cam
Message-ID:  <201811262250.wAQMoUbP079234@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Mon Nov 26 22:50:30 2018
New Revision: 341003
URL: https://svnweb.freebsd.org/changeset/base/341003

Log:
  Minor tweaks to the formatting
  
  Tweak the format of the trim + read bias code. Add similar debug to
  the read + writes case.
  
  Spondored by: Netflix

Modified:
  head/sys/cam/cam_iosched.c

Modified: head/sys/cam/cam_iosched.c
==============================================================================
--- head/sys/cam/cam_iosched.c	Mon Nov 26 22:45:58 2018	(r341002)
+++ head/sys/cam/cam_iosched.c	Mon Nov 26 22:50:30 2018	(r341003)
@@ -1240,7 +1240,7 @@ cam_iosched_get_write(struct cam_iosched_softc *isc)
 			    "Reads present and current_read_bias is %d queued "
 			    "writes %d queued reads %d\n",
 			    isc->current_read_bias, isc->write_stats.queued,
-    			    isc->read_stats.queued);
+			    isc->read_stats.queued);
 		isc->current_read_bias--;
 		/* We're not limiting writes, per se, just doing reads first */
 		return NULL;
@@ -1326,14 +1326,18 @@ cam_iosched_get_trim(struct cam_iosched_softc *isc)
 	if (!cam_iosched_has_more_trim(isc))
 		return NULL;
 #ifdef CAM_IOSCHED_DYNAMIC
+	/*
+	 * If pending read, prefer that based on current read bias setting. The
+	 * read bias is shared for both writes and TRIMs, but on TRIMs the bias
+	 * is for a combined TRIM not a single TRIM request that's come in.
+	 */
 	if (do_dynamic_iosched) {
-		/*
-		 * If pending read, prefer that based on current read bias
-		 * setting. The read bias is shared for both writes and
-		 * TRIMs, but on TRIMs the bias is for a combined TRIM
-		 * not a single TRIM request that's come in.
-		 */
 		if (bioq_first(&isc->bio_queue) && isc->current_read_bias) {
+			if (iosched_debug)
+				printf("Reads present and current_read_bias is %d"
+				    " queued trims %d queued reads %d\n",
+				    isc->current_read_bias, isc->trim_stats.queued,
+				    isc->read_stats.queued);
 			isc->current_read_bias--;
 			/* We're not limiting TRIMS, per se, just doing reads first */
 			return NULL;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201811262250.wAQMoUbP079234>