From owner-svn-src-head@freebsd.org Thu Sep 28 01:27:01 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AAD02E2194D; Thu, 28 Sep 2017 01:27:01 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 78CB86921A; Thu, 28 Sep 2017 01:27:01 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8S1R0g5062364; Thu, 28 Sep 2017 01:27:00 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8S1R02d062363; Thu, 28 Sep 2017 01:27:00 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201709280127.v8S1R02d062363@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 28 Sep 2017 01:27:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324075 - head/sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/nvme X-SVN-Commit-Revision: 324075 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Sep 2017 01:27:01 -0000 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