From: Jan Kara <jack@suse.cz>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Bj?rn Steinbrink <B.Steinbrink@gmx.de>,
Krzysztof Oledzki <olel@ans.pl>,
Andrew Morton <akpm@linux-foundation.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Nick Piggin <nickpiggin@yahoo.com.au>,
Peter Zijlstra <peterz@infradead.org>,
Thomas Osterried <osterried@jesse.de>,
protasnb@gmail.com, bugme-daemon@bugzilla.kernel.org
Subject: Re: [Bug 9182] Critical memory leak (dirty pages)
Date: Thu, 20 Dec 2007 18:25:51 +0100 [thread overview]
Message-ID: <20071220172551.GE764@atrey.karlin.mff.cuni.cz> (raw)
In-Reply-To: <alpine.LFD.0.9999.0712200753040.21557@woody.linux-foundation.org>
> On Thu, 20 Dec 2007, Bj?rn Steinbrink wrote:
> >
> > OK, so I looked for PG_dirty anyway.
> >
> > In 46d2277c796f9f4937bfa668c40b2e3f43e93dd0 you made try_to_free_buffers
> > bail out if the page is dirty.
> >
> > Then in 3e67c0987d7567ad666641164a153dca9a43b11d, Andrew fixed
> > truncate_complete_page, because it called cancel_dirty_page (and thus
> > cleared PG_dirty) after try_to_free_buffers was called via
> > do_invalidatepage.
> >
> > Now, if I'm not mistaken, we can end up as follows.
> >
> > truncate_complete_page()
> > cancel_dirty_page() // PG_dirty cleared, decr. dirty pages
> > do_invalidatepage()
> > ext3_invalidatepage()
> > journal_invalidatepage()
> > journal_unmap_buffer()
> > __dispose_buffer()
> > __journal_unfile_buffer()
> > __journal_temp_unlink_buffer()
> > mark_buffer_dirty(); // PG_dirty set, incr. dirty pages
>
> Good, this seems to be the exact path that actually triggers it. I got to
> journal_unmap_buffer(), but was too lazy to actually then bother to follow
> it all the way down - I decided that I didn't actually really even care
> what the low-level FS layer did, I had already convinced myself that it
> obviously must be dirtying the page some way, since that matched the
> symptoms exactly (ie only the journaling case was impacted, and this was
> all about the journal).
>
> But perhaps more importantly: regardless of what the low-level filesystem
> did at that point, the VM accounting shouldn't care, and should be robust
> in the face of a low-level filesystem doing strange and wonderful things.
> But thanks for bothering to go through the whole history and figure out
> what exactly is up.
As I wrote in my previous email, this solution works but hides the
fact that the page really *has* dirty data in it and *is* pinned in memory
until the commit code gets to writing it. So in theory it could disturb
the writeout logic by having more dirty data in memory than vm thinks it
has. Not that I'd have a better fix now but I wanted to point out this
problem.
Honza
--
Jan Kara <jack@suse.cz>
SuSE CR Labs
next prev parent reply other threads:[~2007-12-20 17:26 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20071215221935.306A5108068@picon.linux-foundation.org>
2007-12-15 23:08 ` Krzysztof Oledzki
2007-12-16 4:35 ` Andrew Morton
2007-12-16 9:33 ` Krzysztof Oledzki
2007-12-16 9:51 ` Andrew Morton
2007-12-16 13:46 ` Krzysztof Oledzki
2007-12-16 21:51 ` Andrew Morton
2007-12-17 14:26 ` Jan Kara
2007-12-17 17:17 ` Krzysztof Oledzki
2007-12-19 17:44 ` Linus Torvalds
2007-12-20 1:05 ` Jan Kara
2007-12-20 1:19 ` Nick Piggin
2007-12-20 14:12 ` Björn Steinbrink
2007-12-20 15:04 ` Jan Kara
2007-12-20 16:05 ` Jan Kara
2007-12-20 16:25 ` Linus Torvalds
2007-12-20 17:25 ` Jan Kara [this message]
2007-12-20 19:24 ` Linus Torvalds
2007-12-21 1:59 ` Nick Piggin
2007-12-20 22:28 ` Björn Steinbrink
2007-12-21 19:59 ` Krzysztof Oledzki
2007-12-21 20:42 ` [PATCH] Fix dirty page accounting leak with ext3 data=journal Björn Steinbrink
[not found] <20071216095834.1B899108069@picon.linux-foundation.org>
2007-12-16 10:12 ` [Bug 9182] Critical memory leak (dirty pages) Krzysztof Oledzki
[not found] <20071205213750.14194108010@picon.linux-foundation.org>
[not found] ` <Pine.LNX.4.64.0712052238520.21312@bizon.gios.gov.pl>
[not found] ` <Pine.LNX.4.64.0712111844510.21312@bizon.gios.gov.pl>
2007-12-12 13:28 ` Krzysztof Oledzki
[not found] <20071205135655.1A832108010@picon.linux-foundation.org>
2007-12-05 14:09 ` Krzysztof Oledzki
2007-09-28 8:42 Strange system hangs Krzysztof Oledzki
2007-09-28 20:14 ` Nick Piggin
2007-12-02 15:09 ` Krzysztof Oledzki
[not found] ` <200712030936.25363.osterried@jesse.de>
2007-12-13 15:17 ` [Bug 9182] Critical memory leak (dirty pages) Krzysztof Oledzki
2007-12-13 15:44 ` Peter Zijlstra
2007-12-13 16:16 ` Krzysztof Oledzki
2007-12-15 12:33 ` Krzysztof Oledzki
2007-12-15 21:53 ` Krzysztof Oledzki
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=20071220172551.GE764@atrey.karlin.mff.cuni.cz \
--to=jack@suse.cz \
--cc=B.Steinbrink@gmx.de \
--cc=akpm@linux-foundation.org \
--cc=bugme-daemon@bugzilla.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nickpiggin@yahoo.com.au \
--cc=olel@ans.pl \
--cc=osterried@jesse.de \
--cc=peterz@infradead.org \
--cc=protasnb@gmail.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
all inboxes | Powered by JetHome®