From: Christoph Hellwig <hch@lst.de>
To: Keith Busch <kbusch@kernel.org>
Cc: Christoph Hellwig <hch@lst.de>,
linux-nvme@lists.infradead.org, sagi@grimberg.me
Subject: Re: [PATCHv3] nvme: skip noiob for zoned devices
Date: Tue, 18 Aug 2020 20:02:05 +0200 [thread overview]
Message-ID: <20200818180205.GA29087@lst.de> (raw)
In-Reply-To: <20200818175054.GB3097355@dhcp-10-100-145-180.wdl.wdc.com>
On Tue, Aug 18, 2020 at 10:50:54AM -0700, Keith Busch wrote:
> On Tue, Aug 18, 2020 at 07:25:04PM +0200, Christoph Hellwig wrote:
> > > - if (iob)
> > > - blk_queue_chunk_sectors(ns->queue, rounddown_pow_of_two(iob));
> > > + if (iob) {
> > > + if (!blk_queue_is_zoned(disk->queue))
> > > + blk_queue_chunk_sectors(ns->queue, rounddown_pow_of_two(iob));
> > > + else if (!(disk->flags & GENHD_FL_UP))
> > > + pr_warn("%s: zone namespace has unused IO boundary:%u\n",
> > > + disk->disk_name, iob);
> >
> > This has some overly long line and looks fairly convoluted, what
> > about something like:
> >
> > if (iob) {
> > unsigned int chunk_sectors = rounddown_pow_of_two(iob);
>
> Unrelated to this particular patch, but ... why is this rounddown here?
> While we can't use chunk_sectors if it is not a power of two, but what
> benefit are we expecting to get from using the wrong boundary just
> because it's convenient to our block stack?
True, might make sense to add a validity check instead.
>
> > if (blk_queue_is_zoned(disk->queue) &&
> > chunk_sectors > blk_queue_zone_sectors(disk->queue))
>
> I don't think we should skip iob just for the case where chunk_sectors
> is the larger value. A smaller value still ruins things like
> blk_queue_zone_sectors() and blk_queue_zone_no().
>
> Also, we call blk_revalidate_disk_zones() after the iob check, so the
> blk_queue_zone_sectors() hasn't been initialized for this revalidate.
>
> > pr_warn("%s: ignoring too large IO boundary: %u\n",
> > disk->disk_name, iob);
>
> We don't want to emit a repeated warning on every disk revalidation, so
> I added the check for GENHD_FL_UP to warn only on the very first disk
> validation.
Ok. Maybe we just need to move the whole thing into a helper to look
less confusing.
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
next prev parent reply other threads:[~2020-08-18 18:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-18 16:29 [PATCHv3] nvme: skip noiob for zoned devices Keith Busch
2020-08-18 17:25 ` Christoph Hellwig
2020-08-18 17:50 ` Keith Busch
2020-08-18 18:02 ` Christoph Hellwig [this message]
2020-08-18 19:10 ` Sagi Grimberg
2020-08-18 19:20 ` Christoph Hellwig
2020-08-18 19:32 ` Sagi Grimberg
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=20200818180205.GA29087@lst.de \
--to=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=sagi@grimberg.me \
/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.