zbd: reset one zone at a time
authorNaohiro Aota <naohiro.aota@wdc.com>
Fri, 28 Feb 2020 07:12:44 +0000 (16:12 +0900)
committerJens Axboe <axboe@kernel.dk>
Wed, 18 Mar 2020 02:05:54 +0000 (20:05 -0600)
commit4803b8419f03e9d97a992329b895a0dd3d025b84
tree4a4749660df2bb485fae2b43afd0928e44e383e1
parent409a4f291e7f4011f6ccfe748c6ed9786431ddb3
zbd: reset one zone at a time

zbd_rest_zones() currently scans over device zones and try to reset as much
zones as possible at a time. However, this routine takes all the lock on
the range and causes a lot of lock contentions with other threads.

This commit change the behavior to hold the lock and examine one zone at a
time. While it will increase the number of ioctl() call when it need to
reset contiguous, the overhead of increased number of ioctl()s are anyway
amortized by device side's reset performance.

Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
Tested-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
zbd.c