All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: linux-kernel@vger.kernel.org,
	linux-pm@lists.linux-foundation.org, arnd@arndb.de,
	oleg@redhat.com, lizf@cn.fujitsu.com, paul@paulmenage.org,
	Matt Helsley <matthltc@us.ibm.com>,
	Martin Schwidefsky <schwidefsky@de.ibm.com>
Subject: Re: [GIT PULL pm-next] freezer: fix various bugs and simplify implementation
Date: Mon, 22 Aug 2011 11:58:57 +0200	[thread overview]
Message-ID: <20110822095857.GD24151@htj.dyndns.org> (raw)
In-Reply-To: <201108212003.14722.rjw@sisk.pl>

Hello, Rafael.

On Sun, Aug 21, 2011 at 08:03:14PM +0200, Rafael J. Wysocki wrote:
> 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.

Hmmm... I can't quite agree with this change.  Some invocations of
try_to_freeze() can be very difficult to trigger.  Freezing isn't a
frequent operation after some try_to_freeze() can be buried in weird
places.  might_sleep() is exactly to detect context bugs in these
situations.  If a code path is called from both sleepable and
unsleepable context and it knows that the latter wouldn't happen if
the system is freezing, that code path should conditionalize
invocation of try_to_freeze() based on its knowledge of context.  That
way, all other normal cases get the might_sleep() protection and the
peculiar logic in that code path is explicitly described - win win.

Can you please point me to where the problem was?

Thanks.

-- 
tejun

  parent reply	other threads:[~2011-08-22  9:59 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
2011-08-21 18:03     ` Rafael J. Wysocki
2011-08-22  9:58       ` Tejun Heo
2011-08-22  9:58       ` Tejun Heo [this message]
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=20110822095857.GD24151@htj.dyndns.org \
    --to=tj@kernel.org \
    --cc=arnd@arndb.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=lizf@cn.fujitsu.com \
    --cc=matthltc@us.ibm.com \
    --cc=oleg@redhat.com \
    --cc=paul@paulmenage.org \
    --cc=rjw@sisk.pl \
    --cc=schwidefsky@de.ibm.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.