linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sonny Rao <sonny@burdell.org>
To: Badari Pulavarty <pbadari@us.ibm.com>
Cc: linux-fsdevel@vger.kernel.org,
	ext2-devel <ext2-devel@lists.sourceforge.net>,
	Andrew Morton <akpm@osdl.org>
Subject: Re: [Ext2-devel] Bufferheads & page-cache reference
Date: Mon, 14 Feb 2005 14:31:53 -0500	[thread overview]
Message-ID: <20050214193153.GA3057@kevlar.burdell.org> (raw)
In-Reply-To: <1108409415.20053.1278.camel@dyn318077bld.beaverton.ibm.com>

On Mon, Feb 14, 2005 at 11:30:16AM -0800, Badari Pulavarty wrote:
> Hi,,
> 
> I am trying to understand interactions between filesystem pagecache
> pages & bufferhead associated with them. 
> 
> I was wondering if someone could help me clarify this..
> 
> I see that as part of bufferheads to page association, we get a
> ref. on the page.
> 
>   create_empty_buffers() -> attach_page_buffers() -> page_cache_get()
> 
> I also see that this reference get dropped by ..
> 
>   shrink_list() -> try_to_release_page() ->
>         try_to_free_buffers() -> drop_buffers() ->
>                  __clear_page_buffers()-> page_cache_release();
> 
> So, it looks like we drop the reference on the page and disassociate
> bufferheads from the page when VM wants to re-use the page. Only other
> path, I see this can happen is through invalidate_mapping_pages().
> Is this true ?
> 
> If I do fsync(), we flush the data - still leave the page & bufferhead
> association. If I see lots of bufferheads even after fsync() is normal.
> Correct ?

Also Badari, a minor addition in the same vein, if a_ops->releasepage
gets called journal_try_to_free_buffers() will be called by
ext3_releasepage, which may actually release the buffers before
try_to_free_buffers() does.  I believe this should happen in the
shrink_list->try_to_release_page case.

I can't find any other place where the buffers would be released after
a normal ext3 write.

Here's a list of the callers of try_to_free_buffers:


release_buffer_page: 		fs/jbd/commit.c:72
journal_try_to_free_bufers:	fs/jbd/transaction.c:1633
mpage_writepage:		fs/mpage.c:563
try_to_release_page:		fs/buffer.c:1584
grow_dev_page:			fs/buffer.c:1137

XFS only
linvfs_release_page:		fs/xfs/linux-2.6/xfs_aops.c:1250

I looked at all of these and callers to "free_buffer_head" but didn't
see any obvious freeing until we release the whole page under memory
pressure, etc.

Sonny

  reply	other threads:[~2005-02-14 19:45 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-14 19:30 Bufferheads & page-cache reference Badari Pulavarty
2005-02-14 19:31 ` Sonny Rao [this message]
2005-02-14 21:40 ` Andrew Morton
2005-02-14 22:10   ` William Lee Irwin III
2005-02-14 22:31     ` Andrew Morton
2005-02-14 22:50       ` William Lee Irwin III
2005-02-15  0:22         ` Badari Pulavarty
2005-02-15  2:57           ` Andrew Morton
2005-02-15 16:03             ` Badari Pulavarty
2005-02-15 17:26               ` Andrew Morton
2005-02-15  1:27   ` Badari Pulavarty
2005-02-15  3:05     ` Andrew Morton
2005-02-15 16:46       ` Badari Pulavarty
2005-02-15 17:54         ` Andrew Morton
2005-02-15 18:15           ` Badari Pulavarty
2005-02-15 19:07           ` Nikita Danilov
2005-02-15 19:39             ` Badari Pulavarty
2005-02-15 20:00               ` Andrew Morton
2005-02-16  0:02           ` [RFC] [PATCH] Generic mpage_writepage() support Badari Pulavarty
2005-02-16 11:41             ` Nikita Danilov
2005-02-16 18:37               ` Badari Pulavarty
2005-02-16 19:09                 ` Dave Kleikamp
2005-02-16 19:28                   ` Badari Pulavarty
2005-02-16 19:43                     ` Dave Kleikamp
2005-02-16 21:38                       ` [Ext2-devel] " Badari Pulavarty
2005-02-16 21:46                         ` Dave Kleikamp
2005-02-17  0:13                           ` [RFC] [PATCH] nobh_write_page() support Badari Pulavarty

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=20050214193153.GA3057@kevlar.burdell.org \
    --to=sonny@burdell.org \
    --cc=akpm@osdl.org \
    --cc=ext2-devel@lists.sourceforge.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=pbadari@us.ibm.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;
as well as URLs for NNTP newsgroup(s).