From mboxrd@z Thu Jan 1 00:00:00 1970 From: Badari Pulavarty Subject: Re: Bufferheads & page-cache reference Date: 15 Feb 2005 08:46:07 -0800 Message-ID: <1108485967.20053.1438.camel@dyn318077bld.beaverton.ibm.com> References: <1108409415.20053.1278.camel@dyn318077bld.beaverton.ibm.com> <20050214134058.1402cfed.akpm@osdl.org> <1108430825.20053.1363.camel@dyn318077bld.beaverton.ibm.com> <20050214190556.07c4a0c9.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 e2.ny.us.ibm.com ([32.97.182.142]:48789 "EHLO e2.ny.us.ibm.com") by vger.kernel.org with ESMTP id S261781AbVBOQpV (ORCPT ); Tue, 15 Feb 2005 11:45:21 -0500 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e2.ny.us.ibm.com (8.12.11/8.12.11) with ESMTP id j1FGjKoE008486 for ; Tue, 15 Feb 2005 11:45:20 -0500 Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by d01relay04.pok.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id j1FGjKfN216746 for ; Tue, 15 Feb 2005 11:45:20 -0500 Received: from d01av01.pok.ibm.com (loopback [127.0.0.1]) by d01av01.pok.ibm.com (8.12.11/8.12.11) with ESMTP id j1FGjJo3019903 for ; Tue, 15 Feb 2005 11:45:20 -0500 To: Andrew Morton In-Reply-To: <20050214190556.07c4a0c9.akpm@osdl.org> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Mon, 2005-02-14 at 19:05, Andrew Morton wrote: > Badari Pulavarty wrote: > > > > Is there anything wrong, if we tear down bufferheads after the > > writepage/writepages is complete ? may be "-nobh" option for ext3 ? > > The I/O completion will happen in interrupt context, which isn't really a > good place to remove those bh's - the buffer_heads would need to be removed > from their journal_heads first. That's assuming data=ordered. > > For data=writeback we could perhaps inspect buffer_heads_over_limit in > end_buffer_async_write(), and if true, try to strip the buffers in > interrupt context. > > For data=ordered the best place would be in checkpoint.c somewhere, where > we're detaching buffer_heads from a completed transaction: trylock the > page, strip the journal_heads, try to strip the buffers, unlock page. Makes sense. But I am not going to do it, till I figure out *if* there is a real issue with bufferheads & doing this makes sense. > > > 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 ? > > For ext2 nobh we never attach buffer_heads to regular pagecache pages. > They're only used for metadata. nobh_prepare_write() doesn't add them and > neither does writepages(). Hmm.. Yep. nobh_prepare_write() doesn't add any bufferheads. But we call block_write_full_page() even for "nobh" case, which does create bufferheads, attaches to the page and operates on them.. __block_write_full_page() { .... .... if (!page_has_buffers(page)) { create_empty_buffers(page, 1 << inode->i_blkbits, (1 << BH_Dirty)|(1 << BH_Uptodate)); } ... } I am missing something really simple here. What is it ? Thanks, Badari