public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Shaohua Li <shli@fb.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: <linux-block@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<axboe@fb.com>, <Kernel-team@fb.com>,
	"4.2+" <stable@vger.kernel.org>,
	Ming Lei <ming.lei@canonical.com>
Subject: Re: [PATCH] block: don't make BLK_DEF_MAX_SECTORS too big
Date: Tue, 29 Mar 2016 15:01:10 -0700	[thread overview]
Message-ID: <20160329220053.GA1716708@devbig084.prn1.facebook.com> (raw)
In-Reply-To: <20160329211833.GA18532@infradead.org>

On Tue, Mar 29, 2016 at 02:18:33PM -0700, Christoph Hellwig wrote:
> On Tue, Mar 29, 2016 at 09:42:33AM -0700, Shaohua Li 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.
> 
> This might be true, but it's not a good enough reason.  Request based
> driver couldn't care less about the limits of bio_alloc_bioset.
> 
> It seems the bug is that somone (would be great to know whoe exactly)
> passes a too large value to bio_alloc_bioset. And given that we still
> have bio_add_page around for actually adding pages to a bio it seems
> like the proper fix would be to simply clamp down the actual allocation
> and segment limit inside bio_alloc_bioset.  Which would also help to
> eventually remove code doing just that in tons of callers.

The problem is bcache allocates a big bio (with bio_alloc). The bio is
split with blk_queue_split, but it isn't split to small size because
queue limit. the bio is cloned later in md, which uses bio_alloc_bioset.
bio_alloc_bioset itself can't allocate big size bio.

  reply	other threads:[~2016-03-29 22:01 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 [this message]
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
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=20160329220053.GA1716708@devbig084.prn1.facebook.com \
    --to=shli@fb.com \
    --cc=Kernel-team@fb.com \
    --cc=axboe@fb.com \
    --cc=hch@infradead.org \
    --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