[REVIEW] xfssyncd lost wakes circa 2.6.32
Ben Myers
bpm at sgi.com
Wed Nov 23 14:30:41 CST 2011
On Thu, Nov 24, 2011 at 06:42:16AM +1100, NeilBrown wrote:
> On Wed, 23 Nov 2011 10:30:46 -0600 Ben Myers <bpm at sgi.com> 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
More information about the xfs
mailing list