From 633c572996d7dec06aadab7b7befca8aa1738e54 Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Wed, 31 Oct 2012 23:44:19 +0000 Subject: [PATCH] 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 --- sys/dev/nvme/nvme_qpair.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/dev/nvme/nvme_qpair.c b/sys/dev/nvme/nvme_qpair.c index 9de0e4c0cc2..fabdc4cb78f 100644 --- a/sys/dev/nvme/nvme_qpair.c +++ b/sys/dev/nvme/nvme_qpair.c @@ -390,7 +390,12 @@ nvme_qpair_submit_cmd(struct nvme_qpair *qpair, struct nvme_tracker *tr) 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));