From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: NeilBrown <neilb@suse.de>,
Linus Torvalds <torvalds@linux-foundation.org>,
Kent Overstreet <koverstreet@google.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
linux-raid@vger.kernel.org, linux-mm@kvack.org,
David Rientjes <rientjes@google.com>,
Maxime Bizon <mbizon@freebox.fr>,
linux-arm-kernel@lists.infradead.org
Subject: Re: Recent 3.x kernels: Memory leak causing OOMs
Date: Tue, 1 Apr 2014 15:04:01 +0100 [thread overview]
Message-ID: <20140401140401.GZ7528@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <20140401113851.GA15317@n2100.arm.linux.org.uk>
On Tue, Apr 01, 2014 at 12:38:51PM +0100, Russell King - ARM Linux wrote:
> Consider what happens when bio_alloc_pages() fails. j starts off as one
> for non-recovery operations, and we enter the loop to allocate the pages.
> j is post-decremented to zero. So, bio = r1_bio->bios[0].
>
> bio_alloc_pages(bio) fails, we jump to out_free_bio. The first thing
> that does is increment j, so we free from r1_bio->bios[1] up to the
> number of raid disks, leaving r1_bio->bios[0] leaked as the r1_bio is
> then freed.
Neil,
Can you please review commit a07876064a0b7 (block: Add bio_alloc_pages)
which seems to have introduced this bug - it seems to have gone in during
the v3.10 merge window, and looks like it was never reviewed from the
attributations on the commit.
The commit message is brief, and inadequately describes the functional
change that the patch has - we go from "get up to RESYNC_PAGES into the
bio's io_vec" to "get all RESYNC_PAGES or fail completely".
Not withstanding the breakage of the error cleanup paths, is this an
acceptable change of behaviour here?
Thanks.
--
FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly
improving, and getting towards what was expected from it.
next prev parent reply other threads:[~2014-04-01 14:04 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-16 20:05 Recent 3.x kernels: Memory leak causing OOMs Russell King - ARM Linux
2014-02-16 21:43 ` Theodore Ts'o
2014-02-17 18:34 ` Catalin Marinas
2014-02-16 22:17 ` David Rientjes
2014-02-16 22:50 ` Russell King - ARM Linux
2014-02-16 23:42 ` David Rientjes
2014-02-17 21:02 ` Maxime Bizon
2014-02-17 21:09 ` Russell King - ARM Linux
2014-03-15 10:19 ` Russell King - ARM Linux
2014-03-17 7:07 ` NeilBrown
2014-03-17 8:51 ` Russell King - ARM Linux
2014-03-17 18:18 ` Catalin Marinas
2014-03-17 19:33 ` Russell King - ARM Linux
2014-04-01 9:19 ` Russell King - ARM Linux
2014-04-01 11:38 ` Russell King - ARM Linux
2014-04-01 14:04 ` Russell King - ARM Linux [this message]
2014-04-02 23:28 ` NeilBrown
2014-04-01 15:58 ` Catalin Marinas
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=20140401140401.GZ7528@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=catalin.marinas@arm.com \
--cc=koverstreet@google.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mm@kvack.org \
--cc=linux-raid@vger.kernel.org \
--cc=mbizon@freebox.fr \
--cc=neilb@suse.de \
--cc=rientjes@google.com \
--cc=torvalds@linux-foundation.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).