From 32a971e7499a5a83ce9921a0f36a3d127b1b57e4 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Thu, 5 Aug 2021 14:35:34 -0700 Subject: [PATCH] Enable /proc/diskstats for zvols The /proc/diskstats accounting needs to be explicitly enabled for block devices which do not use multi-queue. Reviewed-by: Tony Nguyen Reviewed-by: George Melikov Signed-off-by: Brian Behlendorf Closes #12440 Closes #12066 --- module/os/linux/zfs/zvol_os.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/module/os/linux/zfs/zvol_os.c b/module/os/linux/zfs/zvol_os.c index 8b29d73a3e..c174234263 100644 --- a/module/os/linux/zfs/zvol_os.c +++ b/module/os/linux/zfs/zvol_os.c @@ -837,6 +837,9 @@ zvol_alloc(dev_t dev, const char *name) /* Disable write merging in favor of the ZIO pipeline. */ blk_queue_flag_set(QUEUE_FLAG_NOMERGES, zso->zvo_queue); + /* Enable /proc/diskstats */ + blk_queue_flag_set(QUEUE_FLAG_IO_STAT, zso->zvo_queue); + zso->zvo_queue->queuedata = zv; zso->zvo_dev = dev; zv->zv_open_count = 0;