public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Shaohua Li <shli@fb.com>
To: Ming Lei <ming.lei@canonical.com>
Cc: <linux-block@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Jens Axboe <axboe@fb.com>, FB Kernel Team <Kernel-team@fb.com>,
	"4.2+" <stable@vger.kernel.org>
Subject: Re: [PATCH] block: don't make BLK_DEF_MAX_SECTORS too big
Date: Tue, 29 Mar 2016 19:27:00 -0700	[thread overview]
Message-ID: <20160330022651.GA2147487@devbig084.prn1.facebook.com> (raw)
In-Reply-To: <CACVXFVM2Kvqym-sFh_YFjWUOLdK7F3zr78uBXbNPijCoUSppKg@mail.gmail.com>

On Wed, Mar 30, 2016 at 09:39:35AM +0800, Ming Lei wrote:
> On Wed, Mar 30, 2016 at 12:42 AM, Shaohua Li <shli@fb.com> wrote:
> > bio_alloc_bioset() allocates bvecs from bvec_slabs which can only
> > allocate maximum 256 bvec (eg, 1M for 4k pages). We can't bump
> > BLK_DEF_MAX_SECTORS to exceed this value otherwise bio_alloc_bioset will
> > fail.
> >
> > In the future, we can extend the size either bvec_slabs array is
> > expanded or the upcoming multipage bvec is added if pages are
> > contiguous. This one is suitable for stable.
> >
> > Fixes: d2be537c3ba (block: bump BLK_DEF_MAX_SECTORS to 2560)
> > Reported-by: Sebastian Roesner <sroesner-kernelorg@roesner-online.de>
> > Cc: stable@vger.kernel.org (4.2+)
> > Cc: Ming Lei <ming.lei@canonical.com>
> > Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
> > Signed-off-by: Shaohua Li <shli@fb.com>
> > ---
> >  include/linux/blkdev.h | 6 +++++-
> >  1 file changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
> > index 7e5d7e0..da64325 100644
> > --- a/include/linux/blkdev.h
> > +++ b/include/linux/blkdev.h
> > @@ -1153,7 +1153,11 @@ extern int blk_verify_command(unsigned char *cmd, fmode_t has_write_perm);
> >  enum blk_default_limits {
> >         BLK_MAX_SEGMENTS        = 128,
> >         BLK_SAFE_MAX_SECTORS    = 255,
> > -       BLK_DEF_MAX_SECTORS     = 2560,
> > +       /*
> > +        * if you change this, please also change bvec_alloc and BIO_MAX_PAGES.
> > +        * Otherwise bio_alloc_bioset will break.
> > +        */
> > +       BLK_DEF_MAX_SECTORS     = BIO_MAX_SECTORS,
> 
> Thinking about it further, it isn't good to change the default max
> sectors because
> the patch affects REQ_PC bios too, which don't have the 1Mbytes limit at all.

what breaks setting REQ_PC to 1M limit? I can understand bigger limit might help
big raid array performance, but REQ_PC isn't the case.

> So suggest to just change bcache's queue max sector limit to 1M, that means
> we shouldn't encourage bcache's usage of bypassing bio_add_page().

Don't think this is a good idea. This is a limitation of block core,
block core should make sure the limitation doesn't break, not the
driver. On the other hand, are you going to fix all drivers? drivers can
set arbitrary max sector limit.

Thanks,
Shaohua

  reply	other threads:[~2016-03-30  2:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-29 16:42 [PATCH] block: don't make BLK_DEF_MAX_SECTORS too big Shaohua Li
2016-03-29 21:18 ` Christoph Hellwig
2016-03-29 22:01   ` Shaohua Li
2016-03-30  6:51     ` Christoph Hellwig
2016-03-30 16:50       ` Shaohua Li
2016-03-30 17:40         ` Christoph Hellwig
2016-03-31  0:52         ` Kent Overstreet
2016-03-30  1:39 ` Ming Lei
2016-03-30  2:27   ` Shaohua Li [this message]
2016-03-30 12:13     ` Ming Lei
2016-03-30 17:07       ` Shaohua Li
2016-03-31  0:49         ` Ming Lei

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=20160330022651.GA2147487@devbig084.prn1.facebook.com \
    --to=shli@fb.com \
    --cc=Kernel-team@fb.com \
    --cc=axboe@fb.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ming.lei@canonical.com \
    --cc=stable@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