blk-mq: reinsert cached request to the list

JIRA: https://redhat.atlassian.net/browse/RHEL-213155
CVE: CVE-2026-64017
Backported from tree(s): linux

blk-mq: reinsert cached request to the list

A previous commit removed an optimization out of caution for a scenario
that turns out not to be real: all the "queue_exit" goto's are safe to
reinsert the request into the cached_rq's plug list as they are either
from a non-blocking path, or a successful merge that already holds the
queue reference. This optimization is most needed for small sequential
workloads that successfully merge into larger requests.

Fixes: dc278e9bf2b9 ("blk-mq: pop cached request if it is usable")
Suggested-by: Ming Lei <tom.leiming@gmail.com>
Suggested-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Link: https://patch.msgid.link/20260526153531.2365935-1-kbusch@meta.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
(cherry picked from commit b051bb6bf0a231117036aa607cadf55be8e63910)
Signed-off-by: CKI Backport Bot <cki-ci-bot+cki-gitlab-backport-bot@redhat.com>
This commit is contained in:
CKI Backport Bot
2026-07-21 14:20:20 +00:00
parent 75ece9f111
commit 8f29e6998a
+1 -1
View File
@@ -3224,7 +3224,7 @@ queue_exit:
if (!rq)
blk_queue_exit(q);
else
blk_mq_free_request(rq);
rq_list_add_head(&plug->cached_rqs, rq);
}
#ifdef CONFIG_BLK_MQ_STACKING