xfs
[Top] [All Lists]

Re: [patch] Prevent excessive xfsaild wakeups

To: David Chinner <dgc@xxxxxxx>
Subject: Re: [patch] Prevent excessive xfsaild wakeups
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Wed, 20 Feb 2008 14:10:00 -0500
Cc: xfs-dev <xfs-dev@xxxxxxx>, xfs-oss <xfs@xxxxxxxxxxx>
In-reply-to: <20080218225906.GS155407@sgi.com>
References: <20080218225906.GS155407@sgi.com>
Sender: xfs-bounce@xxxxxxxxxxx
User-agent: Mutt/1.5.17 (2007-11-01)
On Tue, Feb 19, 2008 at 09:59:06AM +1100, David Chinner wrote:
> +     if (count && (XFS_LSN_CMP(lsn, target) >= 0)) {
> +             /*
> +              * We reached the target so wait a bit longer for I/O to
> +              * complete and remove pushed items from the AIL before we
> +              * start the next scan from the start of the AIL.
> +              */
>               tout += 20;
>               last_pushed_lsn = 0;
> +     } else if (!count) {
> +             /* We're past our target or empty, so idle */
> +             tout = 1000;
>       } else if ((restarts > XFS_TRANS_PUSH_AIL_RESTARTS) ||
>                  (count && ((stuck * 100) / count > 90))) {
>               /*

When looking at this conditions it confuses the hell out of me.  Having
count checked in each of three nested conditionals simply isn't readable
:)

Also some checks seem to be superflous, so how about:


        if (!count) {
                /*
                 * We're past our target or empty, so idle.
                 */
                 tout = 1000;
        } else if (XFS_LSN_CMP(lsn, target) >= 0) {
                /*
                 * We reached the target so wait a bit longer for I/O to
                 * complete and remove pushed items from the AIL before we
                 * start the next scan from the start of the AIL.
                 */
                tout += 20;
                last_pushed_lsn = 0;
        } else (restarts > XFS_TRANS_PUSH_AIL_RESTARTS ||
                ((stuck * 100) / count > 90)) {
                ...
        }


<Prev in Thread] Current Thread [Next in Thread>