Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 1 Feb 2018 21:12:09 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r328736 - stable/11/sys/cam/nvme
Message-ID:  <201802012112.w11LC9MB078323@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Thu Feb  1 21:12:09 2018
New Revision: 328736
URL: https://svnweb.freebsd.org/changeset/base/328736

Log:
  MFC r323625 (by imp):  Allow multiple TRIMs to be done for nda
  
  Don't call cam_iosched_trim_done or cam_iosched_submit_trim for nda
  since its hardware can handle almost an arbitrary number of TRIMs and
  we don't have to be careful to only ever do one.

Modified:
  stable/11/sys/cam/nvme/nvme_da.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/cam/nvme/nvme_da.c
==============================================================================
--- stable/11/sys/cam/nvme/nvme_da.c	Thu Feb  1 21:11:17 2018	(r328735)
+++ stable/11/sys/cam/nvme/nvme_da.c	Thu Feb  1 21:12:09 2018	(r328736)
@@ -918,7 +918,12 @@ ndastart(struct cam_periph *periph, union ccb *start_c
 			nda_nvme_trim(softc, &start_ccb->nvmeio, dsm_range, 1);
 			start_ccb->ccb_h.ccb_state = NDA_CCB_TRIM;
 			start_ccb->ccb_h.flags |= CAM_UNLOCKED;
-			cam_iosched_submit_trim(softc->cam_iosched);	/* XXX */
+			/*
+			 * Note: We can have multiple TRIMs in flight, so we don't call
+			 * cam_iosched_submit_trim(softc->cam_iosched);
+			 * since that forces the I/O scheduler to only schedule one at a time.
+			 * On NVMe drives, this is a performance disaster.
+			 */
 			goto out;
 		}
 		case BIO_FLUSH:
@@ -1005,7 +1010,11 @@ ndadone(struct cam_periph *periph, union ccb *done_ccb
 			TAILQ_INIT(&queue);
 			TAILQ_CONCAT(&queue, &softc->trim_req.bps, bio_queue);
 #endif
-			cam_iosched_trim_done(softc->cam_iosched);
+			/*
+			 * Since we can have multiple trims in flight, we don't
+			 * need to call this here.
+			 * cam_iosched_trim_done(softc->cam_iosched);
+			 */
 			ndaschedule(periph);
 			cam_periph_unlock(periph);
 #ifdef notyet



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