]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: impose max limit on apoll cache
authorJens Axboe <axboe@kernel.dk>
Thu, 7 Jul 2022 20:20:54 +0000 (14:20 -0600)
committerJens Axboe <axboe@kernel.dk>
Mon, 25 Jul 2022 00:39:17 +0000 (18:39 -0600)
commit3ff092bd85c1fb66e736bb02ea18da590dd2d7c0
treeb28facb6c0ee4796e2787a5c736231a73520993f
parenta5ce1f7f71c24c01aa058cca77d61f56185f4af4
io_uring: impose max limit on apoll cache

Caches like this tend to grow to the peak size, and then never get any
smaller. Impose a max limit on the size, to prevent it from growing too
big.

A somewhat randomly chosen 512 is the max size we'll allow the cache
to get. If a batch of frees come in and would bring it over that, we
simply start kfree'ing the surplus.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
include/linux/io_uring_types.h
io_uring/alloc_cache.h
io_uring/io_uring.c