]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: fix poll/netmsg alloc caches
authorPavel Begunkov <asml.silence@gmail.com>
Thu, 30 Mar 2023 12:52:38 +0000 (06:52 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 6 Apr 2023 10:10:52 +0000 (12:10 +0200)
commitb38e00c7803a4a939d29d66f6acc479dac3661b4
treebd7b4b1dff698b1f2bdb265b616475a1109f3db2
parent0e9bba38bdc6b81c00b5e0725882038c8859c432
io_uring: fix poll/netmsg alloc caches

commit fd30d1cdcc4ff405fc54765edf2e11b03f2ed4f3 upstream.

We increase cache->nr_cached when we free into the cache but don't
decrease when we take from it, so in some time we'll get an empty
cache with cache->nr_cached larger than IO_ALLOC_CACHE_MAX, that fails
io_alloc_cache_put() and effectively disables caching.

Fixes: a5ce1f7f71c24 ("io_uring: add abstraction around apoll cache")
Cc: stable@vger.kernel.org
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
io_uring/alloc_cache.h