[PATCH] sync_sb_inodes sync hang

From: Hugh Dickins
Date: Tue Feb 24 2004 - 11:55:39 EST


2.6.3-mm UP without PREEMPT easily hangs looping around pdflush's
sync_sb_inodes, failing the down_read_trylock in do_writepages,
but giving the concurrent sync no chance to complete: just try
while : ; do echo $SECONDS; sync; cp /etc/termcap .; done

I think sync_sb_inodes is the only loop vulnerable to that
change in do_writepages, so site the cond_resched() here.

Hugh

--- 2.6.3-mm3/fs/fs-writeback.c 2004-02-23 12:51:49.000000000 +0000
+++ linux/fs/fs-writeback.c 2004-02-24 16:14:49.000000000 +0000
@@ -326,6 +326,7 @@ sync_sb_inodes(struct super_block *sb, s
writeback_release(bdi);
spin_unlock(&inode_lock);
iput(inode);
+ cond_resched();
spin_lock(&inode_lock);
if (wbc->nr_to_write <= 0)
break;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/