• Jens Axboe's avatar
    io_uring: improve registered buffer accounting for huge pages · de293938
    Jens Axboe authored
    io_uring does account any registered buffer as pinned/locked memory, and
    checks limit and fails if the given user doesn't have a big enough limit
    to register the ranges specified. However, if huge pages are used, we
    are potentially under-accounting the memory in terms of what gets pinned
    on the vm side.
    
    This patch rectifies that, by ensuring that we account the full size of
    a compound page, regardless of how much of it is being registered. Huge
    pages are not accounted mulitple times - if multiple sections of a huge
    page is registered, then the page is only accounted once.
    Reported-by: default avatarAndrea Arcangeli <aarcange@redhat.com>
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    de293938
io_uring.c 231 KB