• J
    io_uring: limit parallelism of buffered writes · bf41fc20
    Jens Axboe 提交于
    commit 54a91f3bb9b96ed86bc12b2f7e06b3fce8e86503 upstream.
    
    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: NAndres Freund <andres@anarazel.de>
    Signed-off-by: NJens Axboe <axboe@kernel.dk>
    Signed-off-by: NJoseph Qi <joseph.qi@linux.alibaba.com>
    Reviewed-by: NXiaoguang Wang <xiaoguang.wang@linux.alibaba.com>
    bf41fc20
io_uring.c 87.9 KB