From: Jens Axboe <jens.axboe@oracle.com>
To: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Li Zefan <lizf@cn.fujitsu.com>, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] block: fix memory leak in bio_clone()
Date: Mon, 9 Mar 2009 20:21:22 +0100 [thread overview]
Message-ID: <20090309192122.GZ11787@kernel.dk> (raw)
In-Reply-To: <yq1prgqy8wc.fsf@sermon.lab.mkp.net>
On Mon, Mar 09 2009, Martin K. Petersen wrote:
> Jens> The second bug is that it should be using its own bioset, as it is
> Jens> illegal to do multiple __GFP_WAIT allocations on a single mempool
> Jens> and always expect progress.
>
> So how do you propose I go about this?
>
> The original intent was to contain all the integrity blah inside the
> bio_set to make it completely transparent to the caller. That's why the
> bip mempool is hanging off of the bio_set. But obviously two bvecs are
> needed per bio, one to describe data and to describe the integrity
> buffer.
>
> Having two bvec mempools per bio_set seems icky. I guess what you are
> suggesting is that we could have a dedicated bio_integrity_set akin to
> the bio_split_pool. That removes the caller's option of passing a
> dedicated bio_set to the clone command, though. Will that have forward
> progress implications for stacking drivers?
I was just wondering why you wanted to pass the bio_set in to
bio_integrity_clone(), why would the caller care?
Even two mempools isn't that bad. You can reuse the slab of course, and
the mempool should only have a single entry preallocated. But I agree,
it should not be in the bio_set. A dedicated bio_set for the integrity
stuff would be the way to go, and that should provide you all the
forward progress guarantees you need.
--
Jens Axboe
next prev parent reply other threads:[~2009-03-09 19:21 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-09 9:13 [PATCH] block: fix memory leak in bio_clone() Li Zefan
2009-03-09 9:21 ` Li Zefan
2009-03-09 9:24 ` Jens Axboe
2009-03-09 9:34 ` Li Zefan
2009-03-09 9:38 ` Jens Axboe
2009-03-09 9:51 ` Li Zefan
2009-03-09 9:54 ` Jens Axboe
2009-03-09 16:10 ` Martin K. Petersen
2009-03-09 19:21 ` Jens Axboe [this message]
2009-03-10 3:42 ` Martin K. Petersen
2009-03-10 7:29 ` Jens Axboe
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=20090309192122.GZ11787@kernel.dk \
--to=jens.axboe@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lizf@cn.fujitsu.com \
--cc=martin.petersen@oracle.com \
/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.