Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Sep 2017 01:27:00 +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: r324075 - head/sys/dev/nvme
Message-ID:  <201709280127.v8S1R02d062363@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Thu Sep 28 01:27:00 2017
New Revision: 324075
URL: https://svnweb.freebsd.org/changeset/base/324075

Log:
  Tweak performance of nda completions
  
  Use xpt_done_direct in preference to xpt_done when completing a
  successful I/O. Continue to use xpt_done when there's an error, or for
  completion of the submission of a CCB. This eliminates a context
  switch to the cam_doneq thread.
  
  Sponsored by: Netflix
  Suggested by: scottl@

Modified:
  head/sys/dev/nvme/nvme_sim.c

Modified: head/sys/dev/nvme/nvme_sim.c
==============================================================================
--- head/sys/dev/nvme/nvme_sim.c	Wed Sep 27 23:23:41 2017	(r324074)
+++ head/sys/dev/nvme/nvme_sim.c	Thu Sep 28 01:27:00 2017	(r324075)
@@ -73,11 +73,13 @@ nvme_sim_nvmeio_done(void *ccb_arg, const struct nvme_
 	 * it means. Make our best guess, though for the status code.
 	 */
 	memcpy(&ccb->nvmeio.cpl, cpl, sizeof(*cpl));
-	if (nvme_completion_is_error(cpl))
+	if (nvme_completion_is_error(cpl)) {
 		ccb->ccb_h.status = CAM_REQ_CMP_ERR;
-	else
+		xpt_done(ccb);
+	} else {
 		ccb->ccb_h.status = CAM_REQ_CMP;
-	xpt_done(ccb);
+		xpt_done_direct(ccb);
+	}
 }
 
 static void



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