mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: Jens Axboe <jens.axboe@oracle.com>
Cc: Li Zefan <lizf@cn.fujitsu.com>,
	LKML <linux-kernel@vger.kernel.org>,
	martin.petersen@oracle.com
Subject: Re: [PATCH] block: fix memory leak in bio_clone()
Date: Mon, 09 Mar 2009 12:10:27 -0400	[thread overview]
Message-ID: <yq1prgqy8wc.fsf@sermon.lab.mkp.net> (raw)
In-Reply-To: <20090309092407.GI11787@kernel.dk> (Jens Axboe's message of "Mon\, 9 Mar 2009 10\:24\:07 +0100")

>>>>> "Jens" == Jens Axboe <jens.axboe@oracle.com> writes:

Jens> So the leak will not occur, but it does mean that it isn't
Jens> honoring the gfp_mask passed in to bio_clone(), which is the first
Jens> bug.

bio_integrity_clone() had no mask because all callers of it used
GFP_NOIO explicitly.

But as you now recall there is a patch queued that adds the mask :)


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?

-- 
Martin K. Petersen	Oracle Linux Engineering

  parent reply	other threads:[~2009-03-09 16:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-09  9:13 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 [this message]
2009-03-09 19:21     ` Jens Axboe
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=yq1prgqy8wc.fsf@sermon.lab.mkp.net \
    --to=martin.petersen@oracle.com \
    --cc=jens.axboe@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizf@cn.fujitsu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®