aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config/kernel-blk-queue.m415
-rw-r--r--module/os/linux/zfs/zvol_os.c5
2 files changed, 20 insertions, 0 deletions
diff --git a/config/kernel-blk-queue.m4 b/config/kernel-blk-queue.m4
index bb5903b31..15dbe1c7d 100644
--- a/config/kernel-blk-queue.m4
+++ b/config/kernel-blk-queue.m4
@@ -377,6 +377,14 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_MQ], [
(void) blk_mq_alloc_tag_set(&tag_set);
return BLK_STS_OK;
], [])
+ ZFS_LINUX_TEST_SRC([blk_mq_rq_hctx], [
+ #include <linux/blk-mq.h>
+ #include <linux/blkdev.h>
+ ], [
+ struct request rq = {0};
+ struct blk_mq_hw_ctx *hctx = NULL;
+ rq.mq_hctx = hctx;
+ ], [])
])
AC_DEFUN([ZFS_AC_KERNEL_BLK_MQ], [
@@ -384,6 +392,13 @@ AC_DEFUN([ZFS_AC_KERNEL_BLK_MQ], [
ZFS_LINUX_TEST_RESULT([blk_mq], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_BLK_MQ, 1, [block multiqueue is available])
+ AC_MSG_CHECKING([whether block multiqueue hardware context is cached in struct request])
+ ZFS_LINUX_TEST_RESULT([blk_mq_rq_hctx], [
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_BLK_MQ_RQ_HCTX, 1, [block multiqueue hardware context is cached in struct request])
+ ], [
+ AC_MSG_RESULT(no)
+ ])
], [
AC_MSG_RESULT(no)
])
diff --git a/module/os/linux/zfs/zvol_os.c b/module/os/linux/zfs/zvol_os.c
index 0121f17bb..e1ede9851 100644
--- a/module/os/linux/zfs/zvol_os.c
+++ b/module/os/linux/zfs/zvol_os.c
@@ -551,7 +551,12 @@ zvol_request_impl(zvol_state_t *zv, struct bio *bio, struct request *rq,
uint_t taskq_hash;
#ifdef HAVE_BLK_MQ
if (rq)
+#ifdef HAVE_BLK_MQ_RQ_HCTX
blk_mq_hw_queue = rq->mq_hctx->queue_num;
+#else
+ blk_mq_hw_queue =
+ rq->q->queue_hw_ctx[rq->q->mq_map[rq->cpu]]->queue_num;
+#endif
#endif
taskq_hash = cityhash4((uintptr_t)zv, offset >> ZVOL_TASKQ_OFFSET_SHIFT,
blk_mq_hw_queue, 0);