xfs
[Top] [All Lists]

Re: [REVIEW] xfssyncd lost wakes circa 2.6.32

To: NeilBrown <neilb@xxxxxxx>
Subject: Re: [REVIEW] xfssyncd lost wakes circa 2.6.32
From: Ben Myers <bpm@xxxxxxx>
Date: Wed, 23 Nov 2011 14:30:41 -0600
Cc: Dave Chinner <david@xxxxxxxxxxxxx>, Christoph Hellwig <hch@xxxxxxxxxxxxx>, Alex Elder <elder@xxxxxxxxx>, xfs@xxxxxxxxxxx, nfbrown@xxxxxxxx, ataschner@xxxxxxxxxx
In-reply-to: <20111124064216.5ff54077@xxxxxxxxxxxxxx>
References: <20111123163046.GQ29840@xxxxxxx> <20111124064216.5ff54077@xxxxxxxxxxxxxx>
User-agent: Mutt/1.5.18 (2008-05-17)
On Thu, Nov 24, 2011 at 06:42:16AM +1100, NeilBrown wrote:
> On Wed, 23 Nov 2011 10:30:46 -0600 Ben Myers <bpm@xxxxxxx> wrote:
> > Index: linux/fs/xfs/linux-2.6/xfs_sync.c
> > ===================================================================
> > --- linux.orig/fs/xfs/linux-2.6/xfs_sync.c
> > +++ linux/fs/xfs/linux-2.6/xfs_sync.c
> > @@ -620,13 +620,25 @@ xfssyncd(
> >     set_freezable();
> >     timeleft = xfs_syncd_centisecs * msecs_to_jiffies(10);
> >     for (;;) {
> > -           timeleft = schedule_timeout_interruptible(timeleft);
> > -           /* swsusp */
> > -           try_to_freeze();
> > -           if (kthread_should_stop() && list_empty(&mp->m_sync_list))
> > +           set_current_state(TASK_INTERRUPTIBLE);
> > +           spin_lock(&mp->m_sync_lock);
> > +
> > +           if (list_empty(&mp->m_sync_list) && !kthread_should_stop()) {
> > +                   spin_unlock(&mp->m_sync_lock);
> > +
> > +                   timeleft = schedule_timeout_interruptible(timeleft);
> 
> This should be just "schedule_timeout(timeleft)".
> This call sets TASK_INTERRUPTIBLE so we will go to sleep even if we were
> only just woken up.
> 
> I don't really know the XFS code well enough to the rest looks right, but
> with that small fix it certainly doesn't look wrong :-)

Thanks Neil!   I'll get that fixed up.  ;)

-Ben

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