linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Damien Le Moal <Damien.LeMoal@wdc.com>
To: Coly Li <colyli@suse.de>, Christoph Hellwig <hch@lst.de>
Cc: "linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	"hare@suse.com" <hare@suse.com>,
	"axboe@kernel.dk" <axboe@kernel.dk>,
	"linux-bcache@vger.kernel.org" <linux-bcache@vger.kernel.org>,
	"kbusch@kernel.org" <kbusch@kernel.org>
Subject: Re: [RFC PATCH v2 3/4] block: remove queue_is_mq restriction from blk_revalidate_disk_zones()
Date: Mon, 18 May 2020 01:07:13 +0000	[thread overview]
Message-ID: <BY5PR04MB6900CEAF2B5C87BDF6101711E7B80@BY5PR04MB6900.namprd04.prod.outlook.com> (raw)
In-Reply-To: d3fe49f1-d37b-689e-ae0e-078b1254d7e7@suse.de

On 2020/05/16 22:14, Coly Li wrote:
> On 2020/5/16 20:40, Christoph Hellwig wrote:
>> On Sat, May 16, 2020 at 11:54:33AM +0800, Coly Li wrote:
>>> The bcache driver is bio based and NOT request based multiqueued driver,
>>> if a zoned SMR hard drive is used as backing device of a bcache device,
>>> calling blk_revalidate_disk_zones() for the bcache device will fail due
>>> to the following check in blk_revalidate_disk_zones(),
>>> 478       if (WARN_ON_ONCE(!queue_is_mq(q)))
>>> 479             return -EIO;
>>>
>>> Now bcache is able to export the zoned information from the underlying
>>> zoned SMR drives and format zonefs on top of a bcache device, the
>>> resitriction that a zoned device should be multiqueued is unnecessary
>>> for now.
>>>
>>> Although in commit ae58954d8734c ("block: don't handle bio based drivers
>>> in blk_revalidate_disk_zones") it is said that bio based drivers should
>>> not call blk_revalidate_disk_zones() and just manually update their own
>>> q->nr_zones, but this is inaccurate. The bio based drivers also need to
>>> set their zone size and initialize bitmaps for cnv and seq zones, it is
>>> necessary to call blk_revalidate_disk_zones() for bio based drivers.
>>
>> Why would you need these bitmaps for bcache?  There is no reason to
>> serialize requests for stacking drivers, and you can already derive
>> if a zone is sequential or not from whatever internal information
>> you use.
>>
>> So without a user that actually makes sense: NAK.
>>
> 
> It is OK for me to set the zone_nr and zone size without calling
> blk_revalidate_disk_zones().

Yes, no problem with that.

This is how device mapper BIO based targets handle zoned devices. See
dm_set_device_limits() which uses bdev_stack_limits() for handling chunk_sectors
(zone size) and directly set q->limits.zoned to blk_queue_zoned_model(q) of the
the underlying device. For the number of zones, see dm_table_set_restrictions()
which uses blkdev_nr_zones(t->md->disk) to set q->nr_zones. Note that
blkdev_nr_zones() uses the gendisk capacity of the logical device (the bcache
device in your case) and the zone size, so both must be set first before calling
blkdev_nr_zones().


> 
> Coly Li
> 


-- 
Damien Le Moal
Western Digital Research

  parent reply	other threads:[~2020-05-18  1:07 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-16  3:54 [RFC PATCH v2 0/4] block layer change necessary for bcache zoned device support Coly Li
2020-05-16  3:54 ` [RFC PATCH v2 1/4] block: change REQ_OP_ZONE_RESET from 6 to 13 Coly Li
2020-05-16  4:06   ` Chaitanya Kulkarni
2020-05-16  9:33     ` Coly Li
2020-05-16 12:38   ` Christoph Hellwig
2020-05-16 12:44     ` Coly Li
2020-05-16 12:50       ` Christoph Hellwig
2020-05-16 13:05         ` Coly Li
2020-05-16 15:36           ` Christoph Hellwig
2020-05-17  5:30             ` Coly Li
2020-05-18  6:53               ` Hannes Reinecke
2020-05-18  6:56                 ` Damien Le Moal
2020-05-18  0:33   ` Damien Le Moal
2020-05-18  5:09     ` Chaitanya Kulkarni
2020-05-16  3:54 ` [RFC PATCH v2 2/4] block: block: change REQ_OP_ZONE_RESET_ALL from 8 to 15 Coly Li
2020-05-18  0:36   ` Damien Le Moal
2020-05-16  3:54 ` [RFC PATCH v2 3/4] block: remove queue_is_mq restriction from blk_revalidate_disk_zones() Coly Li
2020-05-16 12:40   ` Christoph Hellwig
2020-05-16 13:13     ` Coly Li
2020-05-16 15:35       ` Christoph Hellwig
2020-05-18  1:07       ` Damien Le Moal [this message]
2020-05-18  0:39   ` Damien Le Moal
2020-05-16  3:54 ` [RFC PATCH v2 4/4] block: set bi_size to REQ_OP_ZONE_RESET bio Coly Li
2020-05-16 12:53   ` Christoph Hellwig
2020-05-18  0:59   ` Damien Le Moal
2020-05-18  2:32     ` Coly Li

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=BY5PR04MB6900CEAF2B5C87BDF6101711E7B80@BY5PR04MB6900.namprd04.prod.outlook.com \
    --to=damien.lemoal@wdc.com \
    --cc=axboe@kernel.dk \
    --cc=colyli@suse.de \
    --cc=hare@suse.com \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=linux-bcache@vger.kernel.org \
    --cc=linux-block@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).