]> git.itanic.dy.fi Git - linux-stable/commit
io_uring/kbuf: prune deferred locked cache when tearing down
authorJens Axboe <axboe@kernel.dk>
Tue, 28 Nov 2023 00:02:48 +0000 (17:02 -0700)
committerJens Axboe <axboe@kernel.dk>
Tue, 28 Nov 2023 18:45:02 +0000 (11:45 -0700)
commit07d6063d3d3beb3168d3ac9fdef7bca81254d983
tree7cbaed7cd0f7bad2e5cde263bd40094a9dc5d259
parentb10b73c102a2eab91e1cd62a03d6446f1dfecc64
io_uring/kbuf: prune deferred locked cache when tearing down

We used to just use our page list for final teardown, which would ensure
that we got all the buffers, even the ones that were not on the normal
cached list. But while moving to slab for the io_buffers, we know only
prune this list, not the deferred locked list that we have. This can
cause a leak of memory, if the workload ends up using the intermediate
locked list.

Fix this by always pruning both lists when tearing down.

Fixes: b3a4dbc89d40 ("io_uring/kbuf: Use slab for struct io_buffer objects")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/kbuf.c