The patch titled writeback: don't redirty tail an inode with dirty pages has been added to the -mm tree. Its filename is writeback-dont-redirty-tail-an-inode-with-dirty-pages.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find out what to do about this The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: writeback: don't redirty tail an inode with dirty pages From: Wu Fengguang <fengguang.wu@xxxxxxxxx> Avoid delaying writeback for an expire inode with lots of dirty pages, but no active dirtier at the moment. Previously we only do that for the kupdate case. Any filesystem that does delayed allocation or unwritten extent conversion after IO completion will cause this - for example, XFS. Signed-off-by: Wu Fengguang <fengguang.wu@xxxxxxxxx> Acked-by: Jan Kara <jack@xxxxxxx> Cc: Dave Chinner <david@xxxxxxxxxxxxx> Cc: Christoph Hellwig <hch@xxxxxxxxxxxxx> Cc: Dave Chinner <david@xxxxxxxxxxxxx> Cc: Jens Axboe <axboe@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- fs/fs-writeback.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff -puN fs/fs-writeback.c~writeback-dont-redirty-tail-an-inode-with-dirty-pages fs/fs-writeback.c --- a/fs/fs-writeback.c~writeback-dont-redirty-tail-an-inode-with-dirty-pages +++ a/fs/fs-writeback.c @@ -366,18 +366,7 @@ writeback_single_inode(struct inode *ino spin_lock(&inode_lock); inode->i_state &= ~I_SYNC; if (!(inode->i_state & I_FREEING)) { - if ((inode->i_state & I_DIRTY_PAGES) && wbc->for_kupdate) { - /* - * More pages get dirtied by a fast dirtier. - */ - goto select_queue; - } else if (inode->i_state & I_DIRTY) { - /* - * At least XFS will redirty the inode during the - * writeback (delalloc) and on io completion (isize). - */ - redirty_tail(inode); - } else if (mapping_tagged(mapping, PAGECACHE_TAG_DIRTY)) { + if (mapping_tagged(mapping, PAGECACHE_TAG_DIRTY)) { /* * We didn't write back all the pages. nfs_writepages() * sometimes bales out without doing anything. Redirty @@ -399,7 +388,6 @@ writeback_single_inode(struct inode *ino * soon as the queue becomes uncongested. */ inode->i_state |= I_DIRTY_PAGES; -select_queue: if (wbc->nr_to_write <= 0) { /* * slice used up: queue for next turn @@ -422,6 +410,14 @@ select_queue: inode->i_state |= I_DIRTY_PAGES; redirty_tail(inode); } + } else if (inode->i_state & I_DIRTY) { + /* + * Filesystems can dirty the inode during writeback + * operations, such as delayed allocation during + * submission or metadata updates after data IO + * completion. + */ + redirty_tail(inode); } else if (atomic_read(&inode->i_count)) { /* * The inode is clean, inuse _ Patches currently in -mm which might be from fengguang.wu@xxxxxxxxx are origin.patch linux-next.patch include-linux-fsh-complete-hexification-of-fmode_-constants.patch vfs-o_-bit-numbers-uniqueness-check.patch vfs-introduce-fmode_neg_offset-for-allowing-negative-f_pos.patch writeback-take-account-of-nr_writeback_temp-in-balance_dirty_pages.patch writeback-reduce-calls-to-global_page_state-in-balance_dirty_pages.patch writeback-avoid-unnecessary-calculation-of-bdi-dirty-thresholds.patch writeback-dont-redirty-tail-an-inode-with-dirty-pages.patch writeback-fix-queue_io-ordering.patch writeback-merge-for_kupdate-and-for_kupdate-cases.patch vfs-add-super-operation-writeback_inodes.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html