From: Dave Chinner <david@fromorbit.com>
To: Michal Hocko <mhocko@suse.cz>
Cc: jkosina@suse.cz, "Rafael J. Wysocki" <rjw@rjwysocki.net>,
Hendrik Woltersdorf <hendrikw@arcor.de>,
xfs@oss.sgi.com
Subject: Re: [PATCH] Revert "xfs: clear PF_NOFREEZE for xfsaild kthread"
Date: Fri, 22 Jan 2016 09:24:18 +1100 [thread overview]
Message-ID: <20160121222418.GB6033@dastard> (raw)
In-Reply-To: <20160121102129.GD29520@dhcp22.suse.cz>
On Thu, Jan 21, 2016 at 11:21:30AM +0100, Michal Hocko wrote:
> [CCing Rafael - the thread starts here
> http://lkml.kernel.org/r/1452661968-11482-1-git-send-email-david%40fromorbit.com]
>
> On Thu 21-01-16 08:19:44, Dave Chinner wrote:
> > On Wed, Jan 20, 2016 at 09:47:50AM +0100, Michal Hocko wrote:
> > > On Wed 13-01-16 16:12:48, Dave Chinner wrote:
> > > > This reverts commit 24ba16bb3d499c49974669cd8429c3e4138ab102 as it
> > > > prevents machines from suspending. This regression occurs when the
> > > > xfsaild is idle on entry to suspend, and so there s no activity to
> > > > wake it from it's idle sleep and hence see that it is supposed to
> > > > freeze. Hence the freezer times out waiting for it and suspend is
> > > > cancelled.
> > > >
> > > > There is no obvious fix for this short of freezing the filesystem
> > > > properly, so revert this change for now.
> > >
> > > We had a similar report opensuse bugzilla just recently. I believe the
> > > proper fix should be the following:
> > ....
> > > diff --git a/fs/xfs/xfs_trans_ail.c b/fs/xfs/xfs_trans_ail.c
> > > index aa67339b9537..d6c9c3e9e02b 100644
> > > --- a/fs/xfs/xfs_trans_ail.c
> > > +++ b/fs/xfs/xfs_trans_ail.c
> > > @@ -520,14 +520,14 @@ xfsaild(
> > > if (!xfs_ail_min(ailp) &&
> > > ailp->xa_target == ailp->xa_target_prev) {
> > > spin_unlock(&ailp->xa_lock);
> > > - schedule();
> > > + freezable_schedule();
> >
> > Oh, wonderful. A completely separate set of undocumented schedule
> > functions defined inside the freezer header files that are needed
> > just for freezable kthreads.
>
> Yeah, I am not really happy about them either.
>
> > Perhaps there should be some documentation somewhere on how to write
> > suspend safe kthreads?
>
> There is something in Documentation/power/freezing-of-tasks.txt but
> freezable_schedule* is not mentioned there. Prhaps something like the
> following would make it more clear?
When I did "git grep freezable_schedule" nothing showed up in the
Documentation directory. I'd suggest that the entire API needs
reference in Documentation/scheduler (i.e. all the
freezable_schedule_timeout variants, the wait_event stuff, etc) as
well as in the freezer documentation so that git grep finds them in
the appropriate places....
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2016-01-21 22:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-13 5:12 [PATCH] Revert "xfs: clear PF_NOFREEZE for xfsaild kthread" Dave Chinner
2016-01-13 8:37 ` Jiri Kosina
2016-01-13 13:22 ` Brian Foster
2016-01-20 8:47 ` Michal Hocko
2016-01-20 21:19 ` Dave Chinner
2016-01-21 10:21 ` Michal Hocko
2016-01-21 22:24 ` Dave Chinner [this message]
2016-01-22 9:52 ` Michal Hocko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160121222418.GB6033@dastard \
--to=david@fromorbit.com \
--cc=hendrikw@arcor.de \
--cc=jkosina@suse.cz \
--cc=mhocko@suse.cz \
--cc=rjw@rjwysocki.net \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.