]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
block: enable per-cpu bio cache by default
authorFengnan Chang <changfengnan@bytedance.com>
Fri, 14 Nov 2025 09:21:49 +0000 (17:21 +0800)
committerJens Axboe <axboe@kernel.dk>
Thu, 4 Dec 2025 14:19:24 +0000 (07:19 -0700)
commit48f22f80938d94c34319f90674de6102ca37eabc
tree01f0aba323931a4e59e1335b97a2f97a5fc4a892
parent05ce4c584cc6b783f3f113e9daa5a19f9bcd6e27
block: enable per-cpu bio cache by default

Since after commit 12e4e8c7ab59 ("io_uring/rw: enable bio caches for
IRQ rw"), bio_put is safe for task and irq context, bio_alloc_bioset is
safe for task context and no one calls in irq context, so we can enable
per cpu bio cache by default.

Benchmarked with t/io_uring and ext4+nvme:
taskset -c 6 /root/fio/t/io_uring  -p0 -d128 -b4096 -s1 -c1 -F1 -B1 -R1
-X1 -n1 -P1  /mnt/testfile
base IOPS is 562K, patch IOPS is 574K. The CPU usage of bio_alloc_bioset
decrease from 1.42% to 1.22%.

The worst case is allocate bio in CPU A but free in CPU B, still use
t/io_uring and ext4+nvme:
base IOPS is 648K, patch IOPS is 647K.

Also use fio test ext4/xfs with libaio/sync/io_uring on null_blk and
nvme, no obvious performance regression.

Signed-off-by: Fengnan Chang <changfengnan@bytedance.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/bio.c
block/fops.c
io_uring/rw.c