• Jens Axboe's avatar
    blk-wbt: account flush requests correctly · 0528a533
    Jens Axboe authored
    commit 5235553d upstream.
    
    Mikulas reported a workload that saw bad performance, and figured
    out what it was due to various other types of requests being
    accounted as reads. Flush requests, for instance. Due to the
    high latency of those, we heavily throttle the writes to keep
    the latencies in balance. But they really should be accounted
    as writes.
    
    Fix this by checking the exact type of the request. If it's a
    read, account as a read, if it's a write or a flush, account
    as a write. Any other request we disregard. Previously everything
    would have been mistakenly accounted as reads.
    Reported-by: 's avatarMikulas Patocka <mpatocka@redhat.com>
    Cc: stable@vger.kernel.org # v4.12+
    Signed-off-by: 's avatarJens Axboe <axboe@kernel.dk>
    Signed-off-by: 's avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    0528a533