On Mon, 2005-02-14 at 19:05, Andrew Morton wrote: > Badari Pulavarty <[EMAIL PROTECTED]> 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 - To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html