From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755482AbXL1QZX (ORCPT ); Fri, 28 Dec 2007 11:25:23 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754352AbXL1QZJ (ORCPT ); Fri, 28 Dec 2007 11:25:09 -0500 Received: from e3.ny.us.ibm.com ([32.97.182.143]:43848 "EHLO e3.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754075AbXL1QZI (ORCPT ); Fri, 28 Dec 2007 11:25:08 -0500 Subject: Re: [PATCH] jfs: clear PAGECACHE_TAG_DIRTY for no-write pages From: Dave Kleikamp To: Peter Zijlstra Cc: Fengguang Wu , Andrew Morton , Linux Kernel Mailing List , jfs-discussion@lists.sourceforge.net, Nick Piggin In-Reply-To: <1198841626.6821.92.camel@twins> References: <1198841626.6821.92.camel@twins> Content-Type: text/plain Date: Fri, 28 Dec 2007 10:25:01 -0600 Message-Id: <1198859101.13075.10.camel@norville.austin.ibm.com> Mime-Version: 1.0 X-Mailer: Evolution 2.12.1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2007-12-28 at 12:33 +0100, Peter Zijlstra wrote: > On Fri, 2007-12-28 at 16:03 +0800, Fengguang Wu wrote: > > Andrew, > > > > This patch fixed the 'pdflush stuck in D state' bug > > http://bugzilla.kernel.org/show_bug.cgi?id=9291 > > and should be pushed to mainline ASAP. > > --- > > > > When JFS decides to drop a dirty metapage, it simply clears the META_dirty bit > > and leave alone the PG_dirty and PAGECACHE_TAG_DIRTY bits. > > > > When such no-write page goes to metapage_writepage(), the `relic' > > PAGECACHE_TAG_DIRTY tag should be cleared, to prevent pdflush from > > repeatedly trying to sync them. > > > > Also, avoid the redirty when a bio submission is planned. > > > > Tested-by: Markus Rehbach > > Signed-off-by: Fengguang Wu > > --- > > > +++ b/fs/jfs/jfs_metapage.c > > > @@ -449,9 +450,15 @@ static int metapage_writepage(struct page *page, struct writeback_control *wbc) > > goto dump_bio; > > > > submit_bio(WRITE, bio); > > - } > > - if (redirty) > > + } else if (redirty) { > > redirty_page_for_writepage(wbc, page); > > + } else { > > + write_lock_irq(&mapping->tree_lock); > > + radix_tree_tag_clear(&mapping->page_tree, > > + page_index(page), > > + PAGECACHE_TAG_DIRTY); > > + write_unlock_irq(&mapping->tree_lock); > > + } > > I'm not liking this open-coded tag_clear, although I currently fail to > come up with a nice solution. I'm looking at __block_write_full_page() for guidance. The situation here is similar to writing a page where all the bufferheads are clean. __block_write_full_page() always calls set_page_writeback(page), and then, if no I/O is initiated, immediately calls end_page_writeback(page). I'll put together a patch for testing. Thanks, Shaggy -- David Kleikamp IBM Linux Technology Center