• Ming Lei's avatar
    blk-mq: merge bio into sw queue before plugging · ab42f35d
    Ming Lei authored
    Before blk-mq is introduced, I/O is merged to elevator
    before being putted into plug queue, but blk-mq changed the
    order and makes merging to sw queue basically impossible.
    Then it is observed that throughput of sequential I/O is degraded
    about 10%~20% on virtio-blk in the test[1] if mq-deadline isn't used.
    
    This patch moves the bio merging per sw queue before plugging,
    like what blk_queue_bio() does, and the performance regression is
    fixed under this situation.
    
    [1]. test script:
    sudo fio --direct=1 --size=128G --bsrange=4k-4k --runtime=40 --numjobs=16 --ioengine=libaio --iodepth=64 --group_reporting=1 --filename=/dev/vdb --name=virtio_blk-test-$RW --rw=$RW --output-format=json
    
    RW=read or write
    Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
    Signed-off-by: default avatarMing Lei <ming.lei@redhat.com>
    Signed-off-by: default avatarJens Axboe <axboe@fb.com>
    ab42f35d
blk-mq.c 70 KB