bio: add allocation cache abstraction
authorJens Axboe <axboe@kernel.dk>
Mon, 8 Mar 2021 18:37:47 +0000 (11:37 -0700)
committerJens Axboe <axboe@kernel.dk>
Wed, 11 Aug 2021 22:37:11 +0000 (16:37 -0600)
commita02f2b023671dc69cceaf65b28692556c65684cc
tree57b88157d0d542aae0100ce32efc31b7d1e65972
parentcd5b7d1afe23d6dd7a8034c5629c603119ee87f1
bio: add allocation cache abstraction

Add a per-cpu bio_set cache for bio allocations, enabling us to quickly
recycle them instead of going through the slab allocator. This cache
isn't IRQ safe, and hence is only really suitable for polled IO.

Very simple - keeps a count of bio's in the cache, and maintains a max
of 512 with a slack of 64. If we get above max + slack, we drop slack
number of bio's.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/bio.c
include/linux/bio.h
include/linux/blk_types.h
include/linux/cpuhotplug.h