• Hao Xu's avatar
    io_uring: spin in iopoll() only when reqs are in a single queue · 915b3dde
    Hao Xu authored
    We currently spin in iopoll() when requests to be iopolled are for
    same file(device), while one device may have multiple hardware queues.
    given an example:
    
    hw_queue_0     |    hw_queue_1
    req(30us)           req(10us)
    
    If we first spin on iopolling for the hw_queue_0. the avg latency would
    be (30us + 30us) / 2 = 30us. While if we do round robin, the avg
    latency would be (30us + 10us) / 2 = 20us since we reap the request in
    hw_queue_1 in time. So it's better to do spinning only when requests
    are in same hardware queue.
    Signed-off-by: default avatarHao Xu <haoxu@linux.alibaba.com>
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    915b3dde
io_uring.c 252 KB