All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ming Lei <tom.leiming@gmail.com>
To: Keith Busch <kbusch@kernel.org>
Cc: Tokunori Ikegami <ikegami.t@gmail.com>,
	"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>,
	Chaitanya Kulkarni <Chaitanya.Kulkarni@wdc.com>
Subject: Re: [PATCH] block, nvme: Increase max segments parameter setting value
Date: Sat, 28 Mar 2020 16:28:51 +0800	[thread overview]
Message-ID: <CACVXFVNY++56icyHB4+-aGjRXWZ5B7WdK4z-N336u0+v6sDhbQ@mail.gmail.com> (raw)
In-Reply-To: <20200328031334.GA18429@keith-busch>

On Sat, Mar 28, 2020 at 11:13 AM Keith Busch <kbusch@kernel.org> wrote:
>
> On Sat, Mar 28, 2020 at 10:11:57AM +0800, Ming Lei wrote:
> > On Sat, Mar 28, 2020 at 2:18 AM Keith Busch <kbusch@kernel.org> wrote:
> > >
> > > This is actually even more confusing. We do not support 256MB transfers
> > > within a single command in the pci nvme driver anymore. The max is 4MB,
> > > so I don't see how increasing the max segments will help: you should be
> > > hitting the 'max_sectors' limit if you don't hit the segment limit first.
> >
> > That looks a bug for passthrough req, because 'max_sectors' limit is only
> > checked in bio_add_pc_page(), not done in blk_rq_append_bio(), something
> > like the following seems required:
>
> Shouldn't bio_map_user_iov() or bio_copy_user_iov() have caught the
> length limit before proceeding to blk_rq_append_bio()?

Actually the limit should be caught earlier in bio_add_pc_page(), that requires
to pass 'rq' in, then one perfect passthrough bio can be made before
appending to rq.

Not only max sector limit, max segments & virt_boundary should be checked
in request wide too.

So far, only lightnvm calls bio_add_pc_page() before allocating
request, and that is
the 1st bio, so NULL rq can be passed.

thanks,
Ming Lei

WARNING: multiple messages have this Message-ID (diff)
From: Ming Lei <tom.leiming@gmail.com>
To: Keith Busch <kbusch@kernel.org>
Cc: "linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	Tokunori Ikegami <ikegami.t@gmail.com>,
	Chaitanya Kulkarni <Chaitanya.Kulkarni@wdc.com>,
	"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>
Subject: Re: [PATCH] block, nvme: Increase max segments parameter setting value
Date: Sat, 28 Mar 2020 16:28:51 +0800	[thread overview]
Message-ID: <CACVXFVNY++56icyHB4+-aGjRXWZ5B7WdK4z-N336u0+v6sDhbQ@mail.gmail.com> (raw)
In-Reply-To: <20200328031334.GA18429@keith-busch>

On Sat, Mar 28, 2020 at 11:13 AM Keith Busch <kbusch@kernel.org> wrote:
>
> On Sat, Mar 28, 2020 at 10:11:57AM +0800, Ming Lei wrote:
> > On Sat, Mar 28, 2020 at 2:18 AM Keith Busch <kbusch@kernel.org> wrote:
> > >
> > > This is actually even more confusing. We do not support 256MB transfers
> > > within a single command in the pci nvme driver anymore. The max is 4MB,
> > > so I don't see how increasing the max segments will help: you should be
> > > hitting the 'max_sectors' limit if you don't hit the segment limit first.
> >
> > That looks a bug for passthrough req, because 'max_sectors' limit is only
> > checked in bio_add_pc_page(), not done in blk_rq_append_bio(), something
> > like the following seems required:
>
> Shouldn't bio_map_user_iov() or bio_copy_user_iov() have caught the
> length limit before proceeding to blk_rq_append_bio()?

Actually the limit should be caught earlier in bio_add_pc_page(), that requires
to pass 'rq' in, then one perfect passthrough bio can be made before
appending to rq.

Not only max sector limit, max segments & virt_boundary should be checked
in request wide too.

So far, only lightnvm calls bio_add_pc_page() before allocating
request, and that is
the 1st bio, so NULL rq can be passed.

thanks,
Ming Lei

_______________________________________________
linux-nvme mailing list
linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

  reply	other threads:[~2020-03-28  8:29 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-23 18:23 [PATCH] block, nvme: Increase max segments parameter setting value Tokunori Ikegami
2020-03-23 18:23 ` Tokunori Ikegami
2020-03-23 19:14 ` Chaitanya Kulkarni
2020-03-23 19:14   ` Chaitanya Kulkarni
2020-03-23 23:09   ` Tokunori Ikegami
2020-03-23 23:09     ` Tokunori Ikegami
2020-03-24  0:02     ` Keith Busch
2020-03-24  0:02       ` Keith Busch
2020-03-24 16:51       ` Tokunori Ikegami
2020-03-24 16:51         ` Tokunori Ikegami
2020-03-27 17:50         ` Tokunori Ikegami
2020-03-27 17:50           ` Tokunori Ikegami
2020-03-27 18:18           ` Keith Busch
2020-03-27 18:18             ` Keith Busch
2020-03-28  2:11             ` Ming Lei
2020-03-28  2:11               ` Ming Lei
2020-03-28  3:13               ` Keith Busch
2020-03-28  3:13                 ` Keith Busch
2020-03-28  8:28                 ` Ming Lei [this message]
2020-03-28  8:28                   ` Ming Lei
2020-03-28 12:57               ` Tokunori Ikegami
2020-03-28 12:57                 ` Tokunori Ikegami
2020-03-29  3:01                 ` Ming Lei
2020-03-29  3:01                   ` Ming Lei
2020-03-30  9:15                   ` Tokunori Ikegami
2020-03-30  9:15                     ` Tokunori Ikegami
2020-03-30 13:53                     ` Keith Busch
2020-03-30 13:53                       ` Keith Busch
2020-03-31 15:24                       ` Tokunori Ikegami
2020-03-31 15:24                         ` Tokunori Ikegami
2020-03-31 14:13                     ` Joshi
2020-03-31 14:13                       ` Joshi
2020-03-31 15:37                       ` Tokunori Ikegami
2020-03-31 15:37                         ` Tokunori Ikegami
2020-03-24  7:16 ` Hannes Reinecke
2020-03-24  7:16   ` Hannes Reinecke
2020-03-24 17:17   ` Tokunori Ikegami
2020-03-24 17:17     ` Tokunori Ikegami

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=CACVXFVNY++56icyHB4+-aGjRXWZ5B7WdK4z-N336u0+v6sDhbQ@mail.gmail.com \
    --to=tom.leiming@gmail.com \
    --cc=Chaitanya.Kulkarni@wdc.com \
    --cc=ikegami.t@gmail.com \
    --cc=kbusch@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.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 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.