linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ming Lei <tom.leiming@gmail.com>
To: Keith Busch <kbusch@kernel.org>
Cc: Hannes Reinecke <hare@suse.de>, Christoph Hellwig <hch@lst.de>,
	Johannes Thumshirn <jthumshirn@suse.de>,
	Jens Axboe <axboe@fb.com>, Bart Van Assche <bvanassche@acm.org>,
	Jan Kara <jack@suse.cz>,
	Linux Block Layer Mailinglist <linux-block@vger.kernel.org>,
	Linux FSDEVEL Mailinglist <linux-fsdevel@vger.kernel.org>
Subject: Re: [PATCH v2 3/3] block: bio: introduce BIO_ALLOCED flag and check it in bio_free
Date: Sat, 23 Mar 2019 07:04:24 +0800	[thread overview]
Message-ID: <CACVXFVNPW1TOsCaAibc-YJHDEdK95Y8-v1rHNaab7oV=eb+8TA@mail.gmail.com> (raw)
In-Reply-To: <20190322213031.GD31194@localhost.localdomain>

On Sat, Mar 23, 2019 at 5:30 AM Keith Busch <kbusch@kernel.org> wrote:
>
> On Fri, Mar 22, 2019 at 03:05:46PM +0100, Hannes Reinecke wrote:
> > On 3/22/19 3:02 PM, Christoph Hellwig wrote:
> > > But how do you manage to get the tiny on-stack bios split?  What kind
> > > of setup is this?
> > >
> > It's not tiny if you send a 2M file via direct-io, _and_ have a non-zero
> > MDTS setting...
>
> I see a larger request can create a bio chain (though I think 1M
> is the max that goes through _simple), but how does the stack bio

multi-page bvec is merged now, 1M isn't the max size any more.

> get used in a bio_put()? The chained bios are allocated through a
> bio_set, and their bio_end_io() calls bio_put() on themselves through
> bio_chain_endio(), but that's it. The original's endio is never modified
> from blkdev_bio_end_io_simple(), so who's calling bio_put() on the
> on-stack bio?

I have the same concern, blkdev_bio_end_io_simple() doesn't release
the bio, and this bio shouldn't be released until __blkdev_direct_IO_simple()
returns. How can any underlying driver or block layer free such bio coming
from upper layer?

thanks,
Ming Lei

  reply	other threads:[~2019-03-22 23:04 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-22 13:13 [PATCH v2 0/3] add flag for tracking bio allocation Johannes Thumshirn
2019-03-22 13:13 ` [PATCH v2 1/3] block: bio: kill BIO_SEG_VALID flag Johannes Thumshirn
2019-03-22 14:01   ` Christoph Hellwig
2019-03-25  8:02     ` Johannes Thumshirn
2019-03-22 14:06   ` Hannes Reinecke
2019-03-22 22:00   ` Jens Axboe
2019-03-23 19:31     ` Jens Axboe
2019-03-25 13:32       ` Johannes Thumshirn
2019-03-22 22:40   ` Ming Lei
2019-03-22 13:13 ` [PATCH v2 2/3] block: bio: ensure newly added bio flags don't override BVEC_POOL_IDX Johannes Thumshirn
2019-03-22 14:01   ` Christoph Hellwig
2019-03-22 14:07   ` Hannes Reinecke
2019-03-22 13:13 ` [PATCH v2 3/3] block: bio: introduce BIO_ALLOCED flag and check it in bio_free Johannes Thumshirn
2019-03-22 14:02   ` Christoph Hellwig
2019-03-22 14:05     ` Hannes Reinecke
2019-03-22 21:30       ` Keith Busch
2019-03-22 23:04         ` Ming Lei [this message]
2019-03-22 14:10   ` Hannes Reinecke

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='CACVXFVNPW1TOsCaAibc-YJHDEdK95Y8-v1rHNaab7oV=eb+8TA@mail.gmail.com' \
    --to=tom.leiming@gmail.com \
    --cc=axboe@fb.com \
    --cc=bvanassche@acm.org \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=jack@suse.cz \
    --cc=jthumshirn@suse.de \
    --cc=kbusch@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fsdevel@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).