From Takashi lock profiling shows - mpage_writepages - sync_supers Are causing latency problems. This adds some conditional schedules to help fix things Index: linux.t/fs/fs-writeback.c =================================================================== --- linux.t.orig/fs/fs-writeback.c 2004-03-20 11:03:44.699287043 -0500 +++ linux.t/fs/fs-writeback.c 2004-03-20 11:09:52.295211794 -0500 @@ -302,6 +302,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; @@ -347,6 +348,7 @@ writeback_inodes(struct writeback_contro } spin_unlock(&sb_lock); spin_unlock(&inode_lock); + cond_resched(); } /* Index: linux.t/fs/mpage.c =================================================================== --- linux.t.orig/fs/mpage.c 2004-03-20 11:09:38.499793627 -0500 +++ linux.t/fs/mpage.c 2004-03-20 11:11:23.762645499 -0500 @@ -671,6 +671,7 @@ mpage_writepages(struct address_space *m } } pagevec_release(&pvec); + cond_resched(); } if (bio) mpage_bio_submit(WRITE, bio); Index: linux.t/fs/super.c =================================================================== --- linux.t.orig/fs/super.c 2004-03-20 11:09:39.552672812 -0500 +++ linux.t/fs/super.c 2004-03-20 11:09:52.297211565 -0500 @@ -356,6 +356,7 @@ void sync_supers(void) { struct super_block * sb; restart: + cond_resched(); spin_lock(&sb_lock); sb = sb_entry(super_blocks.next); while (sb != sb_entry(&super_blocks))