From owner-svn-src-all@FreeBSD.ORG Wed Oct 31 23:44:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 70639785; Wed, 31 Oct 2012 23:44:20 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 577AD8FC0A; Wed, 31 Oct 2012 23:44:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9VNiKBj063746; Wed, 31 Oct 2012 23:44:20 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9VNiKxK063744; Wed, 31 Oct 2012 23:44:20 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201210312344.q9VNiKxK063744@svn.freebsd.org> From: Jim Harris Date: Wed, 31 Oct 2012 23:44:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242420 - head/sys/dev/nvme X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2012 23:44:20 -0000 Author: jimharris Date: Wed Oct 31 23:44:19 2012 New Revision: 242420 URL: http://svn.freebsd.org/changeset/base/242420 Log: Use callout_reset_curcpu to allow the callout to be handled by the current CPU and not always CPU 0. This has the added benefit of reducing a huge amount of spinlock contention on the callout_cpu spinlock for CPU 0. Sponsored by: Intel Modified: head/sys/dev/nvme/nvme_qpair.c Modified: head/sys/dev/nvme/nvme_qpair.c ============================================================================== --- head/sys/dev/nvme/nvme_qpair.c Wed Oct 31 22:21:33 2012 (r242419) +++ head/sys/dev/nvme/nvme_qpair.c Wed Oct 31 23:44:19 2012 (r242420) @@ -390,7 +390,12 @@ nvme_qpair_submit_cmd(struct nvme_qpair req->cmd.cid = tr->cid; qpair->act_tr[tr->cid] = tr; +#if __FreeBSD_version >= 800030 + callout_reset_curcpu(&tr->timer, NVME_TIMEOUT_IN_SEC * hz, + nvme_timeout, tr); +#else callout_reset(&tr->timer, NVME_TIMEOUT_IN_SEC * hz, nvme_timeout, tr); +#endif /* Copy the command from the tracker to the submission queue. */ memcpy(&qpair->cmd[qpair->sq_tail], &req->cmd, sizeof(req->cmd));