From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754366Ab0GKCiQ (ORCPT ); Sat, 10 Jul 2010 22:38:16 -0400 Received: from mga02.intel.com ([134.134.136.20]:51523 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753526Ab0GKCiM (ORCPT ); Sat, 10 Jul 2010 22:38:12 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.55,182,1278313200"; d="scan'208";a="534243193" Message-Id: <20100711021749.021449821@intel.com> User-Agent: quilt/0.48-1 Date: Sun, 11 Jul 2010 10:07:00 +0800 From: Wu Fengguang To: Andrew Morton CC: Christoph Hellwig , Dave Chinner , Jan Kara , Wu Fengguang CC: Peter Zijlstra cc: cc: Linux Memory Management List cc: LKML Subject: [PATCH 4/6] writeback: dont redirty tail an inode with dirty pages References: <20100711020656.340075560@intel.com> Content-Disposition: inline; filename=writeback-xfs-fast-redirty.patch Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This avoids delaying writeback for an expired (XFS) inode with lots of dirty pages, but no active dirtier at the moment. Previously we only do that for the kupdate case. CC: Dave Chinner CC: Christoph Hellwig Acked-by: Jan Kara Signed-off-by: Wu Fengguang --- fs/fs-writeback.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) --- linux-next.orig/fs/fs-writeback.c 2010-07-11 08:53:44.000000000 +0800 +++ linux-next/fs/fs-writeback.c 2010-07-11 08:57:35.000000000 +0800 @@ -367,18 +367,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 @@ -400,7 +389,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 @@ -423,6 +411,12 @@ select_queue: inode->i_state |= I_DIRTY_PAGES; redirty_tail(inode); } + } 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 (atomic_read(&inode->i_count)) { /* * The inode is clean, inuse