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
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to