Skip to content
  • Stefan Hajnoczi's avatar
    07668288
    block/linux-aio: convert to blk_io_plug_call() API · 07668288
    Stefan Hajnoczi authored
    
    
    Stop using the .bdrv_co_io_plug() API because it is not multi-queue
    block layer friendly. Use the new blk_io_plug_call() API to batch I/O
    submission instead.
    
    Note that a dev_max_batch check is dropped in laio_io_unplug() because
    the semantics of unplug_fn() are different from .bdrv_co_unplug():
    1. unplug_fn() is only called when the last blk_io_unplug() call occurs,
       not every time blk_io_unplug() is called.
    2. unplug_fn() is per-thread, not per-BlockDriverState, so there is no
       way to get per-BlockDriverState fields like dev_max_batch.
    
    Therefore this condition cannot be moved to laio_unplug_fn(). It is not
    obvious that this condition affects performance in practice, so I am
    removing it instead of trying to come up with a more complex mechanism
    to preserve the condition.
    
    Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
    Reviewed-by: default avatarEric Blake <eblake@redhat.com>
    Acked-by: default avatarKevin Wolf <kwolf@redhat.com>
    Reviewed-by: default avatarStefano Garzarella <sgarzare@redhat.com>
    Message-id: 20230530180959.1108766-6-stefanha@redhat.com
    Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
    07668288
    block/linux-aio: convert to blk_io_plug_call() API
    Stefan Hajnoczi authored
    
    
    Stop using the .bdrv_co_io_plug() API because it is not multi-queue
    block layer friendly. Use the new blk_io_plug_call() API to batch I/O
    submission instead.
    
    Note that a dev_max_batch check is dropped in laio_io_unplug() because
    the semantics of unplug_fn() are different from .bdrv_co_unplug():
    1. unplug_fn() is only called when the last blk_io_unplug() call occurs,
       not every time blk_io_unplug() is called.
    2. unplug_fn() is per-thread, not per-BlockDriverState, so there is no
       way to get per-BlockDriverState fields like dev_max_batch.
    
    Therefore this condition cannot be moved to laio_unplug_fn(). It is not
    obvious that this condition affects performance in practice, so I am
    removing it instead of trying to come up with a more complex mechanism
    to preserve the condition.
    
    Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
    Reviewed-by: default avatarEric Blake <eblake@redhat.com>
    Acked-by: default avatarKevin Wolf <kwolf@redhat.com>
    Reviewed-by: default avatarStefano Garzarella <sgarzare@redhat.com>
    Message-id: 20230530180959.1108766-6-stefanha@redhat.com
    Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
Loading