All of lore.kernel.org
 help / color / mirror / Atom feed
From: Theodore Tso <tytso@mit.edu>
To: Don Porter <porterde@cs.utexas.edu>
Cc: Eric Sandeen <sandeen@redhat.com>, linux-ext4@vger.kernel.org
Subject: Re: ext3 leaking buffer_heads
Date: Tue, 24 Mar 2009 20:46:09 -0400	[thread overview]
Message-ID: <20090325004609.GF32307@mit.edu> (raw)
In-Reply-To: <49C961FE.1030704@cs.utexas.edu>

On Tue, Mar 24, 2009 at 05:43:10PM -0500, Don Porter wrote:
> Thanks for the tip, Eric.
>
> I spent some time tracing through this in a debugger.
>
> I believe the lingering buffer_heads are allocated by  
> journal_write_commit_record()->journal_get_descriptor_buffer()->__getblk(). 
>  The reference count ends up at zero, but the buffer head is never freed.
>
> As best I can tell, this is correct as long as the associated page is  
> cached, so that the associated buffer_head can be looked up and reused  
> later.
>
> I plan to look into this more, but perhaps the issue is just that the  
> kernel should be more aggressive about freeing cached journal pages?   
> They are highly unlikely to be used again once a committed transaction  
> is completely out on disk, as the journal is roughly an append-only log,  
> right?

The journal is a fixed sized, circular log, so the buffer_head will be
reused eventually.  In the case of memory pressure the unreferenced
buffer_head will be freed, but since we never reference the contents
of the journal, we could be more aggressive about freeing the
buffer_head just to avoid pushing out more valuable memory contents
when we start getting put under memory pressure.

					- Ted

  reply	other threads:[~2009-03-25  0:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-23 19:56 ext3 leaking buffer_heads Don Porter
2009-03-23 22:00 ` Eric Sandeen
2009-03-24 22:43   ` Don Porter
2009-03-25  0:46     ` Theodore Tso [this message]
2009-03-25  7:04       ` Don Porter

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=20090325004609.GF32307@mit.edu \
    --to=tytso@mit.edu \
    --cc=linux-ext4@vger.kernel.org \
    --cc=porterde@cs.utexas.edu \
    --cc=sandeen@redhat.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.