All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Snitzer <snitzer@redhat.com>
To: Damien Le Moal <damien.lemoal@wdc.com>
Cc: linux-block@vger.kernel.org, Jens Axboe <axboe@kernel.dk>,
	linux-scsi@vger.kernel.org,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	dm-devel@redhat.com, Christoph Hellwig <hch@lst.de>,
	Matias Bjorling <matias.bjorling@wdc.com>
Subject: Re: [PATCH v4 11/11] block: Introduce blk_revalidate_disk_zones()
Date: Tue, 16 Oct 2018 11:17:58 -0400	[thread overview]
Message-ID: <20181016151758.GB26807@redhat.com> (raw)
In-Reply-To: <20181012100850.23316-12-damien.lemoal@wdc.com>

On Fri, Oct 12 2018 at  6:08am -0400,
Damien Le Moal <damien.lemoal@wdc.com> wrote:

> Drivers exposing zoned block devices have to initialize and maintain
> correctness (i.e. revalidate) of the device zone bitmaps attached to
> the device request queue (seq_zones_bitmap and seq_zones_wlock).
> 
> To simplify coding this, introduce a generic helper function
> blk_revalidate_disk_zones() suitable for most (and likely all) cases.
> This new function always update the seq_zones_bitmap and seq_zones_wlock
> bitmaps as well as the queue nr_zones field when called for a disk
> using a request based queue. For a disk using a BIO based queue, only
> the number of zones is updated since these queues do not have
> schedulers and so do not need the zone bitmaps.
> 
> With this change, the zone bitmap initialization code in sd_zbc.c can be
> replaced with a call to this function in sd_zbc_read_zones(), which is
> called from the disk revalidate block operation method.
> 
> A call to blk_revalidate_disk_zones() is also added to the null_blk
> driver for devices created with the zoned mode enabled.
> 
> Finally, to ensure that zoned devices created with dm-linear or
> dm-flakey expose the correct number of zones through sysfs, a call to
> blk_revalidate_disk_zones() is added to dm_table_set_restrictions().
> 
> The zone bitmaps allocated and initialized with
> blk_revalidate_disk_zones() are freed automatically from
> __blk_release_queue() using the block internal function
> blk_queue_free_zone_bitmaps().
> 
> Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
> Reviewed-by: Hannes Reinecke <hare@suse.com>
> Reviewed-by: Christoph Hellwig <hch@lst.de>

Reviewed-by: Mike Snitzer <snitzer@redhat.com>

WARNING: multiple messages have this Message-ID (diff)
From: Mike Snitzer <snitzer@redhat.com>
To: Damien Le Moal <damien.lemoal@wdc.com>
Cc: Jens Axboe <axboe@kernel.dk>,
	linux-scsi@vger.kernel.org,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	linux-block@vger.kernel.org, dm-devel@redhat.com,
	Christoph Hellwig <hch@lst.de>,
	Matias Bjorling <matias.bjorling@wdc.com>
Subject: Re: [PATCH v4 11/11] block: Introduce blk_revalidate_disk_zones()
Date: Tue, 16 Oct 2018 11:17:58 -0400	[thread overview]
Message-ID: <20181016151758.GB26807@redhat.com> (raw)
In-Reply-To: <20181012100850.23316-12-damien.lemoal@wdc.com>

On Fri, Oct 12 2018 at  6:08am -0400,
Damien Le Moal <damien.lemoal@wdc.com> wrote:

> Drivers exposing zoned block devices have to initialize and maintain
> correctness (i.e. revalidate) of the device zone bitmaps attached to
> the device request queue (seq_zones_bitmap and seq_zones_wlock).
> 
> To simplify coding this, introduce a generic helper function
> blk_revalidate_disk_zones() suitable for most (and likely all) cases.
> This new function always update the seq_zones_bitmap and seq_zones_wlock
> bitmaps as well as the queue nr_zones field when called for a disk
> using a request based queue. For a disk using a BIO based queue, only
> the number of zones is updated since these queues do not have
> schedulers and so do not need the zone bitmaps.
> 
> With this change, the zone bitmap initialization code in sd_zbc.c can be
> replaced with a call to this function in sd_zbc_read_zones(), which is
> called from the disk revalidate block operation method.
> 
> A call to blk_revalidate_disk_zones() is also added to the null_blk
> driver for devices created with the zoned mode enabled.
> 
> Finally, to ensure that zoned devices created with dm-linear or
> dm-flakey expose the correct number of zones through sysfs, a call to
> blk_revalidate_disk_zones() is added to dm_table_set_restrictions().
> 
> The zone bitmaps allocated and initialized with
> blk_revalidate_disk_zones() are freed automatically from
> __blk_release_queue() using the block internal function
> blk_queue_free_zone_bitmaps().
> 
> Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
> Reviewed-by: Hannes Reinecke <hare@suse.com>
> Reviewed-by: Christoph Hellwig <hch@lst.de>

Reviewed-by: Mike Snitzer <snitzer@redhat.com>

  parent reply	other threads:[~2018-10-16 15:17 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-12 10:08 [PATCH v4 00/11] Zoned block device support improvements Damien Le Moal
2018-10-12 10:08 ` [PATCH v4 01/11] scsi: sd_zbc: Rearrange code Damien Le Moal
2018-10-16  4:48   ` Martin K. Petersen
2018-10-16  4:48     ` Martin K. Petersen
2018-10-12 10:08 ` [PATCH v4 02/11] scsi: sd_zbc: Reduce boot device scan and revalidate time Damien Le Moal
2018-10-16  4:50   ` Martin K. Petersen
2018-10-16  4:50     ` Martin K. Petersen
2018-10-12 10:08 ` [PATCH v4 03/11] scsi: sd_zbc: Fix sd_zbc_check_zones() error checks Damien Le Moal
2018-10-12 10:23   ` Hannes Reinecke
2018-10-12 10:23     ` Hannes Reinecke
2018-10-12 11:41     ` Damien Le Moal
2018-10-12 11:41       ` Damien Le Moal
2018-10-16  4:51   ` Martin K. Petersen
2018-10-16  4:51     ` Martin K. Petersen
2018-10-17  7:21   ` Christoph Hellwig
2018-10-17  7:21     ` Christoph Hellwig
2018-10-12 10:08 ` [PATCH v4 04/11] block: Introduce blkdev_nr_zones() helper Damien Le Moal
2018-10-12 10:08 ` [PATCH v4 05/11] block: Limit allocation of zone descriptors for report zones Damien Le Moal
2018-10-12 10:08 ` [PATCH v4 06/11] block: Introduce BLKGETZONESZ ioctl Damien Le Moal
2018-10-12 10:08 ` [PATCH v4 07/11] block: Introduce BLKGETNRZONES ioctl Damien Le Moal
2018-10-12 10:08 ` [PATCH v4 08/11] block: Improve zone reset execution Damien Le Moal
2018-10-12 10:08 ` [PATCH v4 09/11] block: Expose queue nr_zones in sysfs Damien Le Moal
2018-10-12 10:08 ` [PATCH v4 10/11] block: add a report_zones method Damien Le Moal
2018-10-16  4:55   ` Martin K. Petersen
2018-10-16  4:55     ` Martin K. Petersen
2018-10-16 15:17   ` Mike Snitzer
2018-10-16 15:17     ` Mike Snitzer
2018-10-12 10:08 ` [PATCH v4 11/11] block: Introduce blk_revalidate_disk_zones() Damien Le Moal
2018-10-16  5:00   ` Martin K. Petersen
2018-10-16  5:00     ` Martin K. Petersen
2018-10-16 15:17   ` Mike Snitzer [this message]
2018-10-16 15:17     ` Mike Snitzer
2018-10-13 22:43 ` [PATCH v4 00/11] Zoned block device support improvements Jens Axboe
2018-10-15  0:45   ` Damien Le Moal
2018-10-15  0:45     ` Damien Le Moal
2018-10-16  2:34     ` Jens Axboe
2018-10-16  3:43       ` Damien Le Moal
2018-10-16  3:43         ` Damien Le Moal
2018-10-18  7:57       ` Damien Le Moal
2018-10-18  7:57         ` Damien Le Moal
2018-10-23 15:59 ` Jens Axboe
2018-10-24  2:26   ` Martin K. Petersen
2018-10-24  2:26     ` Martin K. Petersen
2018-10-24 15:03     ` Mike Snitzer
2018-10-24 15:03       ` Mike Snitzer
2018-10-24 15:37       ` Martin K. Petersen
2018-10-24 15:37         ` Martin K. Petersen
2018-10-24 16:04         ` Bart Van Assche
2018-10-24 16:04           ` Bart Van Assche
2018-10-25 14:30           ` Jens Axboe
2018-10-25 14:30             ` Jens Axboe
2018-10-24  8:04   ` Damien Le Moal
2018-10-24  8:04     ` Damien Le Moal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181016151758.GB26807@redhat.com \
    --to=snitzer@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=damien.lemoal@wdc.com \
    --cc=dm-devel@redhat.com \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=matias.bjorling@wdc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.