]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
blk-mq: use array manage hctx map instead of xarray
authorFengnan Chang <fengnanchang@gmail.com>
Fri, 28 Nov 2025 08:53:13 +0000 (16:53 +0800)
committerJens Axboe <axboe@kernel.dk>
Fri, 28 Nov 2025 16:09:19 +0000 (09:09 -0700)
commitd0c98769ee7d5db8d699a270690639cde1766cd4
tree736482908a880ed3a624edbcf4cec18c68cd044b
parentc6a45ee7607de3a350008630f4369b1b5ac80884
blk-mq: use array manage hctx map instead of xarray

After commit 4e5cc99e1e48 ("blk-mq: manage hctx map via xarray"), we use
an xarray instead of array to store hctx, but in poll mode, each time
in blk_mq_poll, we need use xa_load to find corresponding hctx, this
introduce some costs. In my test, xa_load may cost 3.8% cpu.

This patch revert previous change, eliminates the overhead of xa_load
and can result in a 3% performance improvement.

Signed-off-by: Fengnan Chang <changfengnan@bytedance.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-mq-tag.c
block/blk-mq.c
block/blk-mq.h
include/linux/blk-mq.h
include/linux/blkdev.h