summaryrefslogtreecommitdiffstats
path: root/sys/dev/nvme/nvme_qpair.c
diff options
context:
space:
mode:
authorjimharris <jimharris@FreeBSD.org>2012-10-31 23:44:19 +0000
committerjimharris <jimharris@FreeBSD.org>2012-10-31 23:44:19 +0000
commitf3df8b16eb1c0f5dc4e8cfd5c4cd4df7f2a32bb2 (patch)
tree32166bd18c19e40db7313e3e2d26c835e3261ccc /sys/dev/nvme/nvme_qpair.c
parent8ca84edc33bb9dc59af3c9bf645c758b797e0a62 (diff)
downloadFreeBSD-src-f3df8b16eb1c0f5dc4e8cfd5c4cd4df7f2a32bb2.zip
FreeBSD-src-f3df8b16eb1c0f5dc4e8cfd5c4cd4df7f2a32bb2.tar.gz
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
Diffstat (limited to 'sys/dev/nvme/nvme_qpair.c')
-rw-r--r--sys/dev/nvme/nvme_qpair.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/dev/nvme/nvme_qpair.c b/sys/dev/nvme/nvme_qpair.c
index 9de0e4c..fabdc4c 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));
OpenPOWER on IntegriCloud