All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Tejun Heo <tj@kernel.org>
Cc: arnd@arndb.de, paul@paulmenage.org, lizf@cn.fujitsu.com,
	linux-kernel@vger.kernel.org, oleg@redhat.com,
	Martin Schwidefsky <schwidefsky@de.ibm.com>,
	linux-pm@lists.linux-foundation.org
Subject: Re: [GIT PULL pm-next] freezer: fix various bugs and simplify implementation
Date: Sun, 21 Aug 2011 20:03:14 +0200	[thread overview]
Message-ID: <201108212003.14722.rjw__15581.2104967938$1313949780$gmane$org@sisk.pl> (raw)
In-Reply-To: <20110821091200.GB24151@htj.dyndns.org>

On Sunday, August 21, 2011, Tejun Heo wrote:
> Hello, Rafafel.
> 
> On Sat, Aug 20, 2011 at 06:33:38PM +0200, Rafael J. Wysocki wrote:
> > >   ssh://master.kernel.org/pub/scm/linux/kernel/git/tj/misc.git freezer
> > 
> > Pulled and stored in the pm-freezer branch in my tree, and merged into
> > the linux-next branch.
> 
> Cool.
> 
> > > FYI, this patchset will cause a conflict with s390 TIF flag fix patch.
> > > The conflict is trivial and Stephen should be able to handle it
> > > without any problem.  Also, I'm planning on doing some further work on
> > > cgroup freezer and then will try to bridge it with job control.  If
> > > that plan fans out, I might ask Oleg to pull from the pm tree.
> > 
> > I'm not sure if Linus likes it.  He generally doesn't want the trees
> > that he pulls from to be entangled this way.
> 
> The job control portion has to go through Linus anyway, so let's see
> how that flies.
> 
> > > This shouldn't matter too much either way but it *might* be a good idea to
> > > keep this line of patches in a separate branch.
> > 
> > I'm going to keep it in the pm-freezer branch anyway (there may be patches
> > on top of it, though)
> 
> Yeah, I'm pretty sure it will need some fix too.

Speaking of which, the addition of might_sleep() to try_to_freeze()
causes a badly looking backtrace to appear during reboot on ARM,
so I'd prefer it to go into __refrigerator().

Please tell me what you think of the patch below.

Rafael

---
From: Rafael J. Wysocki <rjw@sisk.pl>
Subject: PM / Freezer: Move might_sleep() from try_to_freeze()

There are some code paths that call try_to_freeze() from interrupt
context, but doing so they know that the current process cannot
possible be freezing (e.g. during reboot on ARM).  However, the
recently added might_sleep() annotation in try_to_freeze()
triggers in those cases, making it look like there were bugs in
those places, which really isn't the case.

Therefore move might_sleep() from try_to_freeze() to
__refrigerator() so that it doesn't produce false positives.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
---
 include/linux/freezer.h |    1 -
 kernel/freezer.c        |    2 ++
 2 files changed, 2 insertions(+), 1 deletion(-)

Index: linux/include/linux/freezer.h
===================================================================
--- linux.orig/include/linux/freezer.h
+++ linux/include/linux/freezer.h
@@ -41,7 +41,6 @@ extern void thaw_processes(void);
 
 static inline bool try_to_freeze(void)
 {
-	might_sleep();
 	if (likely(!freezing(current)))
 		return false;
 	return __refrigerator(false);
Index: linux/kernel/freezer.c
===================================================================
--- linux.orig/kernel/freezer.c
+++ linux/kernel/freezer.c
@@ -54,6 +54,8 @@ bool __refrigerator(bool check_kthr_stop
 	bool was_frozen = false;
 	long save;
 
+	might_sleep();
+
 	/*
 	 * No point in checking freezing() again - the caller already did.
 	 * Proceed to enter FROZEN.

  reply	other threads:[~2011-08-21 18:03 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-20  9:44 [GIT PULL pm-next] freezer: fix various bugs and simplify implementation Tejun Heo
2011-08-20 16:33 ` Rafael J. Wysocki
2011-08-20 16:33 ` Rafael J. Wysocki
2011-08-21  9:12   ` Tejun Heo
2011-08-21  9:12   ` Tejun Heo
2011-08-21 18:03     ` Rafael J. Wysocki [this message]
2011-08-21 18:03     ` Rafael J. Wysocki
2011-08-22  9:58       ` Tejun Heo
2011-08-22  9:58       ` Tejun Heo
2011-08-22 18:50         ` Rafael J. Wysocki
2011-08-22 18:50         ` Rafael J. Wysocki
2011-08-20  9:44 Tejun Heo

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='201108212003.14722.rjw__15581.2104967938$1313949780$gmane$org@sisk.pl' \
    --to=rjw@sisk.pl \
    --cc=arnd@arndb.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=lizf@cn.fujitsu.com \
    --cc=oleg@redhat.com \
    --cc=paul@paulmenage.org \
    --cc=schwidefsky@de.ibm.com \
    --cc=tj@kernel.org \
    /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.