Skip to content
  • Avishay Traeger's avatar
    Improve accuracy of block migration bandwidth calculation · ff5c52a3
    Avishay Traeger authored
    
    
    block_mig_state.total_time is currently the sum of the read request
    latencies.  This is not very accurate because block migration uses aio and
    so several requests can be submitted at once.  Bandwidth should be computed
    with wall-clock time, not by adding the latencies.  In this case,
    "total_time" has a higher value than it should, and so the computed
    bandwidth is lower than it is in reality.  This means that migration can
    take longer than it needs to.
    However, we don't want to use pure wall-clock time here.  We are computing
    bandwidth in the asynchronous phase, where the migration repeatedly wakes
    up and sends some aio requests.  The computed bandwidth will be used for
    synchronous transfer.
    
    Signed-off-by: default avatarAvishay Traeger <avishay@il.ibm.com>
    Reviewed-by: default avatarMichael Roth <mdroth@linux.vnet.ibm.com>
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
    ff5c52a3