Skip to content

Commit aefb6a2

Browse files
authored
zvol: Temporally disable blk-mq
There was a report of zvol data loss (openzfs#15351) after enabling blk-mq on a zvol backed with 16k physical block sized disks. Out of an abundance of caution, do not allow the user to enable blk-mq until we can look into the issue. Note that blk-mq was not enabled by default on zvols. It was always opt-in via the zvol_use_blk_mq module parameter. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Tony Nguyen <[email protected]> Signed-off-by: Tony Hutter <[email protected]> Addresses: openzfs#15351 Closes openzfs#15378
1 parent 28096c7 commit aefb6a2

File tree

3 files changed

+1
-70
lines changed

3 files changed

+1
-70
lines changed

man/man4/zfs.4

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -2317,63 +2317,6 @@ If
23172317
.Sy zvol_threads
23182318
to the number of CPUs present or 32 (whichever is greater).
23192319
.
2320-
.It Sy zvol_blk_mq_threads Ns = Ns Sy 0 Pq uint
2321-
The number of threads per zvol to use for queuing IO requests.
2322-
This parameter will only appear if your kernel supports
2323-
.Li blk-mq
2324-
and is only read and assigned to a zvol at zvol load time.
2325-
If
2326-
.Sy 0
2327-
(the default) then internally set
2328-
.Sy zvol_blk_mq_threads
2329-
to the number of CPUs present.
2330-
.
2331-
.It Sy zvol_use_blk_mq Ns = Ns Sy 0 Ns | Ns 1 Pq uint
2332-
Set to
2333-
.Sy 1
2334-
to use the
2335-
.Li blk-mq
2336-
API for zvols.
2337-
Set to
2338-
.Sy 0
2339-
(the default) to use the legacy zvol APIs.
2340-
This setting can give better or worse zvol performance depending on
2341-
the workload.
2342-
This parameter will only appear if your kernel supports
2343-
.Li blk-mq
2344-
and is only read and assigned to a zvol at zvol load time.
2345-
.
2346-
.It Sy zvol_blk_mq_blocks_per_thread Ns = Ns Sy 8 Pq uint
2347-
If
2348-
.Sy zvol_use_blk_mq
2349-
is enabled, then process this number of
2350-
.Sy volblocksize Ns -sized blocks per zvol thread.
2351-
This tunable can be use to favor better performance for zvol reads (lower
2352-
values) or writes (higher values).
2353-
If set to
2354-
.Sy 0 ,
2355-
then the zvol layer will process the maximum number of blocks
2356-
per thread that it can.
2357-
This parameter will only appear if your kernel supports
2358-
.Li blk-mq
2359-
and is only applied at each zvol's load time.
2360-
.
2361-
.It Sy zvol_blk_mq_queue_depth Ns = Ns Sy 0 Pq uint
2362-
The queue_depth value for the zvol
2363-
.Li blk-mq
2364-
interface.
2365-
This parameter will only appear if your kernel supports
2366-
.Li blk-mq
2367-
and is only applied at each zvol's load time.
2368-
If
2369-
.Sy 0
2370-
(the default) then use the kernel's default queue depth.
2371-
Values are clamped to the kernel's
2372-
.Dv BLKDEV_MIN_RQ
2373-
and
2374-
.Dv BLKDEV_MAX_RQ Ns / Ns Dv BLKDEV_DEFAULT_RQ
2375-
limits.
2376-
.
23772320
.It Sy zvol_volmode Ns = Ns Sy 1 Pq uint
23782321
Defines zvol block devices behaviour when
23792322
.Sy volmode Ns = Ns Sy default :

module/os/linux/zfs/zvol_os.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1626,18 +1626,6 @@ MODULE_PARM_DESC(zvol_prefetch_bytes, "Prefetch N bytes at zvol start+end");
16261626
module_param(zvol_volmode, uint, 0644);
16271627
MODULE_PARM_DESC(zvol_volmode, "Default volmode property value");
16281628

1629-
#ifdef HAVE_BLK_MQ
1630-
module_param(zvol_blk_mq_queue_depth, uint, 0644);
1631-
MODULE_PARM_DESC(zvol_blk_mq_queue_depth, "Default blk-mq queue depth");
1632-
1633-
module_param(zvol_use_blk_mq, uint, 0644);
1634-
MODULE_PARM_DESC(zvol_use_blk_mq, "Use the blk-mq API for zvols");
1635-
1636-
module_param(zvol_blk_mq_blocks_per_thread, uint, 0644);
1637-
MODULE_PARM_DESC(zvol_blk_mq_blocks_per_thread,
1638-
"Process volblocksize blocks per thread");
1639-
#endif
1640-
16411629
#ifndef HAVE_BLKDEV_GET_ERESTARTSYS
16421630
module_param(zvol_open_timeout_ms, uint, 0644);
16431631
MODULE_PARM_DESC(zvol_open_timeout_ms, "Timeout for ZVOL open retries");

tests/zfs-tests/include/tunables.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ VDEV_VALIDATE_SKIP vdev.validate_skip vdev_validate_skip
8989
VOL_INHIBIT_DEV UNSUPPORTED zvol_inhibit_dev
9090
VOL_MODE vol.mode zvol_volmode
9191
VOL_RECURSIVE vol.recursive UNSUPPORTED
92-
VOL_USE_BLK_MQ UNSUPPORTED zvol_use_blk_mq
92+
VOL_USE_BLK_MQ UNSUPPORTED UNSUPPORTED
9393
XATTR_COMPAT xattr_compat zfs_xattr_compat
9494
ZEVENT_LEN_MAX zevent.len_max zfs_zevent_len_max
9595
ZEVENT_RETAIN_MAX zevent.retain_max zfs_zevent_retain_max

0 commit comments

Comments
 (0)