]> git.baikalelectronics.ru Git - kernel.git/commit
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>
Mon, 23 Aug 2021 19:44:43 +0000 (13:44 -0600)
commit94b92e98906ad97344565846217e958aa09140c7
treecc30999a6c468df13fdd8cdf1997789882e4ff9f
parente4f40caaa6f7f2bb0d81559efaac500a7c1fe12d
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.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/bio.c
include/linux/bio.h
include/linux/blk_types.h
include/linux/cpuhotplug.h