From mboxrd@z Thu Jan 1 00:00:00 1970 From: Badari Pulavarty Subject: Re: Bufferheads & page-cache reference Date: 14 Feb 2005 17:27:06 -0800 Message-ID: <1108430825.20053.1363.camel@dyn318077bld.beaverton.ibm.com> References: <1108409415.20053.1278.camel@dyn318077bld.beaverton.ibm.com> <20050214134058.1402cfed.akpm@osdl.org> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: linux-fsdevel@vger.kernel.org, ext2-devel Received: from e5.ny.us.ibm.com ([32.97.182.145]:64475 "EHLO e5.ny.us.ibm.com") by vger.kernel.org with ESMTP id S261591AbVBOB0K (ORCPT ); Mon, 14 Feb 2005 20:26:10 -0500 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e5.ny.us.ibm.com (8.12.11/8.12.11) with ESMTP id j1F1QAcZ024915 for ; Mon, 14 Feb 2005 20:26:10 -0500 Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by d01relay02.pok.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id j1F1QAEl258468 for ; Mon, 14 Feb 2005 20:26:10 -0500 Received: from d01av04.pok.ibm.com (loopback [127.0.0.1]) by d01av04.pok.ibm.com (8.12.11/8.12.11) with ESMTP id j1F1Q96W028641 for ; Mon, 14 Feb 2005 20:26:10 -0500 To: Andrew Morton In-Reply-To: <20050214134058.1402cfed.akpm@osdl.org> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Mon, 2005-02-14 at 13:40, Andrew Morton wrote: > 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. > Is there anything wrong, if we tear down bufferheads after the writepage/writepages is complete ? may be "-nobh" option for ext3 ? Even for ext2 with "-nobh" and JFS - we seem to attach buffer heads to page in __block_write_full_page() and leave them around. I was thinking, they gets tossed out after the write-out completes. No ? These bufferheads are driving me crazy :) Thanks, Badari