• Jens Axboe's avatar
    io_uring/kbuf: recycle freed mapped buffer ring entries · b10b73c1
    Jens Axboe authored
    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: c392cbec ("io_uring/kbuf: defer release of mapped buffer rings")
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    b10b73c1
kbuf.c 17.6 KB