On Mon, Jun 13, 2022 at 09:08:11PM +0800, Yi Zhang wrote: > Hi Ming > > The kmemleak also can be reproduced on 5.19.0-rc2, pls try to enable > nvme_core multipath and retest. > > # cat /sys/module/nvme_core/parameters/multipath > Y > OK, I can understand the reason now since rqos is only removed for blk-mq queue, then rqos allocated for bio queue is leaked, see disk_release_mq(). The following patch should fix it: diff --git a/block/genhd.c b/block/genhd.c index 556d6e4b38d9..6e7ca8c302aa 100644 --- a/block/genhd.c +++ b/block/genhd.c @@ -1120,9 +1120,10 @@ static const struct attribute_group *disk_attr_groups[] = { NULL }; -static void disk_release_mq(struct request_queue *q) +static void disk_release_queue(struct request_queue *q) { - blk_mq_cancel_work_sync(q); + if (queue_is_mq(q)) + blk_mq_cancel_work_sync(q); /* * There can't be any non non-passthrough bios in flight here, but @@ -1166,8 +1167,7 @@ static void disk_release(struct device *dev) might_sleep(); WARN_ON_ONCE(disk_live(disk)); - if (queue_is_mq(disk->queue)) - disk_release_mq(disk->queue); + disk_release_queue(disk->queue); blkcg_exit_queue(disk->queue); Thanks, Ming