io_uring/kbuf: recycle freed mapped buffer ring entries
stable inclusion from stable-v6.6.5 commit 9e1152a6c2b5488b688f50f81a6af029b2537258 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I8N21P Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=9e1152a6c2b5488b688f50f81a6af029b2537258 -------------------------------- commit b10b73c102a2eab91e1cd62a03d6446f1dfecc64 upstream. Right now we stash any potentially mmap'ed provided ring buffer range for freeing at release time, regardless of when they get unregistered. Since we're keeping track of these ranges anyway, keep track of their registration state as well, and use that to recycle ranges when appropriate rather than always allocate new ones. The lookup is a basic scan of entries, checking for the best matching free entry. Fixes: c392cbecd8ec ("io_uring/kbuf: defer release of mapped buffer rings") Signed-off-by:Jens Axboe <axboe@kernel.dk> Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by:
Zheng Zengkai <zhengzengkai@huawei.com>
Loading
Please sign in to comment