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>
Fri, 30 Jul 2021 20:04:42 +0000 (14:04 -0600)
commit8ad4154fc385ffbe5d800c5933c48eeba0a645ef
tree980740fa51081905ef50e25ddb951cefa453e8ae
parent4669e13cd67f8532be12815ed3d37e775a9bdc16
bio: add allocation cache abstraction

Add a set of helpers that can encapsulate bio allocations, reusing them
as needed. Caller must provide the necessary locking, if any is needed.
The primary intended use case is polled IO from io_uring, which will not
need any external locking.

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