[dm-devel] [PATCH 1/9] block: Enhance blk_revalidate_disk_zones()

Hannes Reinecke hare at suse.de
Fri Nov 8 07:10:55 UTC 2019


On 11/8/19 2:56 AM, Damien Le Moal wrote:
> For ZBC and ZAC zoned devices, the scsi driver revalidation processing
> implemented by sd_revalidate_disk() includes a call to
> sd_zbc_read_zones() which executes a full disk zone report used to
> check that all zones of the disk are the same size. This processing is
> followed by a call to blk_revalidate_disk_zones(), used to initialize
> the device request queue zone bitmaps (zone type and zone write lock
> bitmaps). To do so, blk_revalidate_disk_zones() also executes a full
> device zone report to obtain zone types. As a result, the entire
> zoned block device revalidation process includes two full device zone
> report.
> 
> By moving the zone size checks into blk_revalidate_disk_zones(), this
> process can be optimized to a single full device zone report, leading to
> shorter device scan and revalidation times. This patch implements this
> optimization, reducing the original full device zone report implemented
> in sd_zbc_check_zones() to a single, small, report zones command
> execution to obtain the size of the first zone of the device. Checks
> whether all zones of the device are the same size as the first zone
> size are moved to the generic blk_check_zone() function called from
> blk_revalidate_disk_zones().
> 
> This optimization also has the following benefits:
> 1) fewer memory allocations in the scsi layer during disk revalidation
>    as the potentailly large buffer for zone report execution is not
>    needed.
> 2) Implement zone checks in a generic manner, reducing the burden on
>    device driver which only need to obtain the zone size and check that
>    this size is a power of 2 number of LBAs. Any new type of zoned
>    block device will benefit from this.
> 
> Signed-off-by: Damien Le Moal <damien.lemoal at wdc.com>
> ---
>  block/blk-zoned.c     |  62 +++++++++++++++++++++++-
>  drivers/scsi/sd_zbc.c | 107 ++++++++----------------------------------
>  2 files changed, 80 insertions(+), 89 deletions(-)
> 
Reviewed-by: Hannes Reinecke <hare at suse.de>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		      Teamlead Storage & Networking
hare at suse.de			                  +49 911 74053 688
SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 247165 (AG München), GF: Felix Imendörffer




More information about the dm-devel mailing list