From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id oA88tOFl089741 for ; Mon, 8 Nov 2010 02:55:24 -0600 Received: from mail.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 20C4015F7D7 for ; Mon, 8 Nov 2010 00:56:50 -0800 (PST) Received: from mail.internode.on.net (bld-mail19.adl2.internode.on.net [150.101.137.104]) by cuda.sgi.com with ESMTP id AJq7Pev2vocKlwx6 for ; Mon, 08 Nov 2010 00:56:50 -0800 (PST) Received: from dastard (unverified [121.44.100.105]) by mail.internode.on.net (SurgeMail 3.8f2) with ESMTP id 45137914-1927428 for ; Mon, 08 Nov 2010 19:26:49 +1030 (CDT) Received: from [192.168.1.1] (helo=disappointment) by dastard with esmtp (Exim 4.71) (envelope-from ) id 1PFNWm-0001DD-Ud for xfs@oss.sgi.com; Mon, 08 Nov 2010 19:56:37 +1100 Received: from dave by disappointment with local (Exim 4.72) (envelope-from ) id 1PFNVv-0004ns-5g for xfs@oss.sgi.com; Mon, 08 Nov 2010 19:55:43 +1100 From: Dave Chinner Subject: [PATCH 13/16] xfs: reduce the number of AIL push wakeups Date: Mon, 8 Nov 2010 19:55:16 +1100 Message-Id: <1289206519-18377-14-git-send-email-david@fromorbit.com> In-Reply-To: <1289206519-18377-1-git-send-email-david@fromorbit.com> References: <1289206519-18377-1-git-send-email-david@fromorbit.com> List-Id: XFS Filesystem from SGI List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: xfs-bounces@oss.sgi.com Errors-To: xfs-bounces@oss.sgi.com To: xfs@oss.sgi.com From: Dave Chinner The xfaild often tries to rest to wait for congestion to pass of for IO to complete, but is regularly woken in tail-pushing situations. In severe cases, the xfsaild is getting woken tens of thousands of times a second. Reduce the number needless wakeups by only waking the xfsaild if the new target is larger than the old one. Further make short sleeps uninterruptible as they occur when the xfsaild has decided it needs to back off to allow some IO to complete and being woken early is counter-productive. Signed-off-by: Dave Chinner --- fs/xfs/linux-2.6/xfs_super.c | 18 +++++++++++++++--- 1 files changed, 15 insertions(+), 3 deletions(-) diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c index fa789b7..668b010 100644 --- a/fs/xfs/linux-2.6/xfs_super.c +++ b/fs/xfs/linux-2.6/xfs_super.c @@ -837,8 +837,11 @@ xfsaild_wakeup( struct xfs_ail *ailp, xfs_lsn_t threshold_lsn) { - ailp->xa_target = threshold_lsn; - wake_up_process(ailp->xa_task); + /* only ever move the target forwards */ + if (XFS_LSN_CMP(threshold_lsn, ailp->xa_target) > 0) { + ailp->xa_target = threshold_lsn; + wake_up_process(ailp->xa_task); + } } STATIC int @@ -850,8 +853,17 @@ xfsaild( long tout = 0; /* milliseconds */ while (!kthread_should_stop()) { - schedule_timeout_interruptible(tout ? + /* + * for short sleeps indicating congestion, don't allow us to + * get woken early. Otherwise all we do is bang on the AIL lock + * without making progress. + */ + if (tout && tout <= 20) { + schedule_timeout_uninterruptible(msecs_to_jiffies(tout)); + } else { + schedule_timeout_interruptible(tout ? msecs_to_jiffies(tout) : MAX_SCHEDULE_TIMEOUT); + } /* swsusp */ try_to_freeze(); -- 1.7.2.3 _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs