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 10/11] block: add a report_zones method
Date: Wed, 10 Oct 2018 11:34:54 -0400	[thread overview]
Message-ID: <20181010153453.GA9724@redhat.com> (raw)
In-Reply-To: <20181010015239.24930-11-damien.lemoal@wdc.com>

On Tue, Oct 09 2018 at  9:52pm -0400,
Damien Le Moal <damien.lemoal@wdc.com> wrote:

> From: Christoph Hellwig <hch@lst.de>
> 
> Dispatching a report zones command through the request queue is a major
> pain due to the command reply payload rewriting necessary. Given that
> blkdev_report_zones() is executing everything synchronously, implement
> report zones as a block device file operation instead, allowing major
> simplification of the code in many places.
> 
> sd, null-blk, dm-linear and dm-flakey being the only block device
> drivers supporting exposing zoned block devices, these drivers are
> modified to provide the device side implementation of the
> report_zones() block device file operation.
> 
> For dm-linear and dm-flakey, a new report_zones() target type operation
> is defined so that the upper block layer call can be propagated down to
> the underlying devices of the dm targets.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> [Damien]
> * Changed method block_device argument to gendisk
> * Various bug fixes and improvements
> * Added support for null_blk, dm-linear and dm-flakey.
> Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
> ---
...
> diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
> index c24969b1741b..d183c10872b7 100644
> --- a/include/linux/blkdev.h
> +++ b/include/linux/blkdev.h
> @@ -396,11 +396,6 @@ struct queue_limits {
>  
>  #ifdef CONFIG_BLK_DEV_ZONED
>  
> -struct blk_zone_report_hdr {
> -	unsigned int	nr_zones;
> -	u8		padding[60];
> -};
> -
>  extern unsigned int blkdev_nr_zones(struct block_device *bdev);
>  extern int blkdev_report_zones(struct block_device *bdev,
>  			       sector_t sector, struct blk_zone *zones,
> @@ -1992,6 +1987,9 @@ struct block_device_operations {
>  	int (*getgeo)(struct block_device *, struct hd_geometry *);
>  	/* this callback is with swap_lock and sometimes page table lock held */
>  	void (*swap_slot_free_notify) (struct block_device *, unsigned long);
> +	int (*report_zones)(struct gendisk *, sector_t sector,
> +			    struct blk_zone *zones, unsigned int *nr_zones,
> +			    gfp_t gfp_mask);
>  	struct module *owner;
>  	const struct pr_ops *pr_ops;
>  };

Should this new 'report_zones' method be wrapped with #ifdef
CONFIG_BLK_DEV_ZONED?

Mike

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 10/11] block: add a report_zones method
Date: Wed, 10 Oct 2018 11:34:54 -0400	[thread overview]
Message-ID: <20181010153453.GA9724@redhat.com> (raw)
In-Reply-To: <20181010015239.24930-11-damien.lemoal@wdc.com>

On Tue, Oct 09 2018 at  9:52pm -0400,
Damien Le Moal <damien.lemoal@wdc.com> wrote:

> From: Christoph Hellwig <hch@lst.de>
> 
> Dispatching a report zones command through the request queue is a major
> pain due to the command reply payload rewriting necessary. Given that
> blkdev_report_zones() is executing everything synchronously, implement
> report zones as a block device file operation instead, allowing major
> simplification of the code in many places.
> 
> sd, null-blk, dm-linear and dm-flakey being the only block device
> drivers supporting exposing zoned block devices, these drivers are
> modified to provide the device side implementation of the
> report_zones() block device file operation.
> 
> For dm-linear and dm-flakey, a new report_zones() target type operation
> is defined so that the upper block layer call can be propagated down to
> the underlying devices of the dm targets.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> [Damien]
> * Changed method block_device argument to gendisk
> * Various bug fixes and improvements
> * Added support for null_blk, dm-linear and dm-flakey.
> Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
> ---
...
> diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
> index c24969b1741b..d183c10872b7 100644
> --- a/include/linux/blkdev.h
> +++ b/include/linux/blkdev.h
> @@ -396,11 +396,6 @@ struct queue_limits {
>  
>  #ifdef CONFIG_BLK_DEV_ZONED
>  
> -struct blk_zone_report_hdr {
> -	unsigned int	nr_zones;
> -	u8		padding[60];
> -};
> -
>  extern unsigned int blkdev_nr_zones(struct block_device *bdev);
>  extern int blkdev_report_zones(struct block_device *bdev,
>  			       sector_t sector, struct blk_zone *zones,
> @@ -1992,6 +1987,9 @@ struct block_device_operations {
>  	int (*getgeo)(struct block_device *, struct hd_geometry *);
>  	/* this callback is with swap_lock and sometimes page table lock held */
>  	void (*swap_slot_free_notify) (struct block_device *, unsigned long);
> +	int (*report_zones)(struct gendisk *, sector_t sector,
> +			    struct blk_zone *zones, unsigned int *nr_zones,
> +			    gfp_t gfp_mask);
>  	struct module *owner;
>  	const struct pr_ops *pr_ops;
>  };

Should this new 'report_zones' method be wrapped with #ifdef
CONFIG_BLK_DEV_ZONED?

Mike

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

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-10  1:52 [PATCH 00/11] Zoned block device support improvements Damien Le Moal
2018-10-10  1:52 ` [PATCH 01/11] scsi: sd_zbc: Rearrange code Damien Le Moal
2018-10-10 13:25   ` Christoph Hellwig
2018-10-10 13:25     ` Christoph Hellwig
2018-10-10  1:52 ` [PATCH 02/11] scsi: sd_zbc: Reduce boot device scan and revalidate time Damien Le Moal
2018-10-10 13:26   ` Christoph Hellwig
2018-10-10 13:26     ` Christoph Hellwig
2018-10-10  1:52 ` [PATCH 03/11] scsi: sd_zbc: Fix sd_zbc_check_zones() error checks Damien Le Moal
2018-10-10 13:26   ` Christoph Hellwig
2018-10-10 13:26     ` Christoph Hellwig
2018-10-10  1:52 ` [PATCH 04/11] block: Introduce blkdev_nr_zones() helper Damien Le Moal
2018-10-10 13:26   ` Christoph Hellwig
2018-10-10 13:26     ` Christoph Hellwig
2018-10-10  1:52 ` [PATCH 05/11] block: Limit allocation of zone descriptors for report zones Damien Le Moal
2018-10-10 13:27   ` Christoph Hellwig
2018-10-10 13:27     ` Christoph Hellwig
2018-10-10  1:52 ` [PATCH 06/11] block: Introduce BLKGETZONESZ ioctl Damien Le Moal
2018-10-10 13:27   ` Christoph Hellwig
2018-10-10 13:27     ` Christoph Hellwig
2018-10-10 16:53   ` [dm-devel] " Bart Van Assche
2018-10-10 16:53     ` Bart Van Assche
2018-10-10 16:53     ` Bart Van Assche
2018-10-10  1:52 ` [PATCH 07/11] block: Introduce BLKGETNRZONES ioctl Damien Le Moal
2018-10-10 13:27   ` Christoph Hellwig
2018-10-10 13:27     ` Christoph Hellwig
2018-10-10  1:52 ` [PATCH 08/11] block: Improve zone reset execution Damien Le Moal
2018-10-10 13:28   ` Christoph Hellwig
2018-10-10 13:28     ` Christoph Hellwig
2018-10-10  1:52 ` [PATCH 09/11] block: Expose queue nr_zones in sysfs Damien Le Moal
2018-10-10 13:28   ` Christoph Hellwig
2018-10-10 13:28     ` Christoph Hellwig
2018-10-10 14:05   ` kbuild test robot
2018-10-10 14:05     ` kbuild test robot
2018-10-10 18:44   ` kbuild test robot
2018-10-10 18:44     ` kbuild test robot
2018-10-10  1:52 ` [PATCH 10/11] block: add a report_zones method Damien Le Moal
2018-10-10 14:15   ` Mike Snitzer
2018-10-10 14:15     ` Mike Snitzer
2018-10-10 16:15     ` Mike Snitzer
2018-10-10 16:15       ` Mike Snitzer
2018-10-10 14:40   ` kbuild test robot
2018-10-10 14:40     ` kbuild test robot
2018-10-10 15:34   ` Mike Snitzer [this message]
2018-10-10 15:34     ` Mike Snitzer
2018-10-10 16:25   ` kbuild test robot
2018-10-10 16:25     ` kbuild test robot
2018-10-10  1:52 ` [PATCH 11/11] block: Introduce revalidate_disk_zones() Damien Le Moal
2018-10-10 13:34   ` Christoph Hellwig
2018-10-10 13:34     ` Christoph Hellwig

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=20181010153453.GA9724@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.