aboutsummaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorJens Axboe <[email protected]>2022-07-07 14:20:54 -0600
committerJens Axboe <[email protected]>2022-07-24 18:39:17 -0600
commit9731bc9855dc169f27433fef3c4d0ff3496c512d (patch)
treeb28facb6c0ee4796e2787a5c736231a73520993f /include/linux
parent9b797a37c4bd83b03cedcfbd15852b836f5e562c (diff)
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 <[email protected]>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/io_uring_types.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/io_uring_types.h b/include/linux/io_uring_types.h
index b548da03b563..bf8f95332eda 100644
--- a/include/linux/io_uring_types.h
+++ b/include/linux/io_uring_types.h
@@ -160,6 +160,7 @@ struct io_ev_fd {
struct io_alloc_cache {
struct hlist_head list;
+ unsigned int nr_cached;
};
struct io_ring_ctx {