From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Morton Subject: Re: Bufferheads & page-cache reference Date: Mon, 14 Feb 2005 13:40:58 -0800 Message-ID: <20050214134058.1402cfed.akpm@osdl.org> References: <1108409415.20053.1278.camel@dyn318077bld.beaverton.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: linux-fsdevel@vger.kernel.org, ext2-devel@lists.sourceforge.net Received: from fire.osdl.org ([65.172.181.4]:3514 "EHLO smtp.osdl.org") by vger.kernel.org with ESMTP id S261547AbVBNVlM (ORCPT ); Mon, 14 Feb 2005 16:41:12 -0500 To: Badari Pulavarty In-Reply-To: <1108409415.20053.1278.camel@dyn318077bld.beaverton.ibm.com> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Badari Pulavarty wrote: > > 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 ? Seems about right. There's also the buffer_heads_over_limit logic in mm/vmscan.c and fs/buffer.c. That logic has a hole in that it requires that there be a highmem shortage before we start to reclaim the lowmem buffer_heads, but it is somewhat helpful.