xfs
[Top] [All Lists]

Re: [PATCH 13/16] xfs: reduce the number of AIL push wakeups

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: [PATCH 13/16] xfs: reduce the number of AIL push wakeups
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Tue, 9 Nov 2010 10:51:42 +1100
Cc: xfs@xxxxxxxxxxx
In-reply-to: <20101108113204.GB7654@xxxxxxxxxxxxx>
References: <1289206519-18377-1-git-send-email-david@xxxxxxxxxxxxx> <1289206519-18377-14-git-send-email-david@xxxxxxxxxxxxx> <20101108113204.GB7654@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.20 (2009-06-14)
On Mon, Nov 08, 2010 at 06:32:04AM -0500, Christoph Hellwig wrote:
> >  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);
> > +           }
> 
> How about just setting the state ourselves and calling schedule_timeout?
> That seems a lot more readable to me.  Also we can switch to
> TASK_KILLABLE for the short sleeps, just to not introduce any delay
> in shutting down aild when kthread_stop is called.  It would look
> something like this:
> 
>               if (tout && tout <= 20)
>                       __set_current_state(TASK_KILLABLE);
>               else
>                       __set_current_state(TASK_UNINTERRUPTIBLE);
>               schedule_timeout(tout ?
>                                msecs_to_jiffies(tout) : MAX_SCHEDULE_TIMEOUT);

Yes, seems reasonable. I'll convert it to do this.

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx

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