• Jens Axboe's avatar
    io_uring: limit parallelism of buffered writes · 54a91f3b
    Jens Axboe authored
    All the popular filesystems need to grab the inode lock for buffered
    writes. With io_uring punting buffered writes to async context, we
    observe a lot of contention with all workers hamming this mutex.
    
    For buffered writes, we generally don't need a lot of parallelism on
    the submission side, as the flushing will take care of that for us.
    Hence we don't need a deep queue on the write side, as long as we
    can safely punt from the original submission context.
    
    Add a workqueue with a limit of 2 that we can use for buffered writes.
    This greatly improves the performance and efficiency of higher queue
    depth buffered async writes with io_uring.
    Reported-by: default avatarAndres Freund <andres@anarazel.de>
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    54a91f3b
io_uring.c 87.9 KB