All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] jfs: clear PAGECACHE_TAG_DIRTY for no-write pages
@ 2007-12-28  8:03 ` Fengguang Wu
  0 siblings, 0 replies; 9+ messages in thread
From: Fengguang Wu @ 2007-12-28  8:03 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Linux Kernel Mailing List, shaggy, jfs-discussion

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 <Markus.Rehbach@gmx.de>
Signed-off-by: Fengguang Wu <wfg@mail.ustc.edu.cn> 
---

diff --git a/fs/jfs/jfs_metapage.c b/fs/jfs/jfs_metapage.c
index f5cd8d3..0c3ffc4 100644
--- a/fs/jfs/jfs_metapage.c
+++ b/fs/jfs/jfs_metapage.c
@@ -353,7 +353,8 @@ static int metapage_writepage(struct page *page, struct writeback_control *wbc)
 {
 	struct bio *bio = NULL;
 	unsigned int block_offset;	/* block offset of mp within page */
-	struct inode *inode = page->mapping->host;
+	struct address_space *mapping = page->mapping;
+	struct inode *inode = mapping->host;
 	unsigned int blocks_per_mp = JFS_SBI(inode->i_sb)->nbperpage;
 	unsigned int len;
 	unsigned int xlen;
@@ -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);
+	}
 
 	unlock_page(page);
 


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2007-12-29 15:21 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-28  8:03 [PATCH] jfs: clear PAGECACHE_TAG_DIRTY for no-write pages Fengguang Wu
2007-12-28  8:03 ` Fengguang Wu
2007-12-28 11:33 ` Peter Zijlstra
2007-12-28 11:42   ` Fengguang Wu
2007-12-28 11:42     ` Fengguang Wu
2007-12-28 16:25   ` Dave Kleikamp
2007-12-28 16:53     ` Dave Kleikamp
2007-12-29  2:21       ` Fengguang Wu
2007-12-29  2:21         ` Fengguang Wu
2007-12-29  4:50         ` Dave Kleikamp
2007-12-29  5:51           ` Fengguang Wu
2007-12-29  5:51             ` Fengguang Wu
2007-12-29 15:20             ` Dave Kleikamp

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.