• Dmitry Fomichev's avatar
    dm zoned: reduce overhead of backing device checks · e7fad909
    Dmitry Fomichev authored
    Commit 75d66ffb added backing device health checks and as a part
    of these checks, check_events() block ops template call is invoked in
    dm-zoned mapping path as well as in reclaim and flush path. Calling
    check_events() with ATA or SCSI backing devices introduces a blocking
    scsi_test_unit_ready() call being made in sd_check_events(). Even though
    the overhead of calling scsi_test_unit_ready() is small for ATA zoned
    devices, it is much larger for SCSI and it affects performance in a very
    negative way.
    
    Fix this performance regression by executing check_events() only in case
    of any I/O errors. The function dmz_bdev_is_dying() is modified to call
    only blk_queue_dying(), while calls to check_events() are made in a new
    helper function, dmz_check_bdev().
    Reported-by: default avatarzhangxiaoxu <zhangxiaoxu5@huawei.com>
    Fixes: 75d66ffb ("dm zoned: properly handle backing device failure")
    Cc: stable@vger.kernel.org
    Signed-off-by: default avatarDmitry Fomichev <dmitry.fomichev@wdc.com>
    Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
    e7fad909
dm-zoned-reclaim.c 13.4 KB