From: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
To: unlisted-recipients:; (no To-header on input)
Cc: a.p.zijlstra@chello.nl, rjw@sisk.pl, stern@rowland.harvard.edu,
pavel@ucw.cz, len.brown@intel.com, mingo@elte.hu,
akpm@linux-foundation.org, suresh.b.siddha@intel.com,
lucas.demarchi@profusion.mobi, linux-pm@vger.kernel.org,
rusty@rustcorp.com.au, vatsa@linux.vnet.ibm.com,
ashok.raj@intel.com, linux-kernel@vger.kernel.org,
linux-doc@vger.kernel.org, rdunlap@xenotime.net
Subject: [PATCH v4 0/2] CPU hotplug, Freezer: Fix race between CPU hotplug and freezer
Date: Thu, 27 Oct 2011 19:18:59 +0530 [thread overview]
Message-ID: <20111027134824.20916.46845.stgit@srivatsabhat.in.ibm.com> (raw)
The CPU hotplug notifications sent out by the _cpu_up() and _cpu_down()
functions depends on the value of the 'tasks_frozen' argument passed to them.
(Examples: CPU_ONLINE, CPU_ONLINE_FROZEN, CPU_DEAD, CPU_DEAD_FROZEN).
Thus, it is essential that while the callbacks for those notifications are
running, the state of the system with respect to the tasks being frozen or
not remains unchanged, *throughout that duration*. Hence there is a need for
synchronizing the CPU hotplug code with the freezer subsystem.
This patchset introduces two freezer notifications PM_FREEZE_PREPARE and
PM_POST_THAW to announce the freezer's activities to other interested
subsystems. The CPU hotplug code hooks onto these notifications and prevents
the race between CPU hotplug and freezer, thus ensuring that CPU hotplug
notifications will always be run with the state of the system really being
what the notifications mean.
v4: * Retained the value 0 for the 'tasks_frozen' argument, while calling
_cpu_up() and _cpu_down().
Removed the unnecessary PM_POST_FREEZE and PM_THAW_PREPARE notifications.
v3: * Added synchronization between CPU hotplug and the freezer subsystem
without introducing any new locks in the CPU hotplug call path.
v2: * Removed the atomic_t declaration of tasks_frozen flag and the
atomic_[set|read] functions since they were unnecessary.
* Updated the changelog to give an example scenario where things could go
wrong due to the bug in the CPU hotplug call path.
References:
v1 -> http://thread.gmane.org/gmane.linux.kernel/1198312/
v2 -> http://thread.gmane.org/gmane.linux.kernel/1198312/focus=1199087
v3 -> http://thread.gmane.org/gmane.linux.documentation/3472
--
Srivatsa S. Bhat (2):
PM / Freezer: Introduce PM_FREEZE_PREPARE and PM_POST_THAW notifications
CPU hotplug, Freezer: Synchronize CPU hotplug and Freezer
Documentation/power/notifiers.txt | 4 ++
include/linux/suspend.h | 4 +-
kernel/cpu.c | 76 +++++++++++++++++++++++++++++++++++++
kernel/power/process.c | 8 +++-
4 files changed, 90 insertions(+), 2 deletions(-)
next reply other threads:[~2011-10-27 13:49 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-27 13:48 Srivatsa S. Bhat [this message]
2011-10-27 13:49 ` [PATCH v4 1/2] PM / Freezer: Introduce PM_FREEZE_PREPARE and PM_POST_THAW notifications Srivatsa S. Bhat
2011-10-27 13:49 ` [PATCH v4 2/2] CPU hotplug, Freezer: Synchronize CPU hotplug and Freezer Srivatsa S. Bhat
2011-10-27 20:13 ` Rafael J. Wysocki
2011-10-28 10:43 ` Srivatsa S. Bhat
2011-10-28 11:57 ` Rafael J. Wysocki
2011-10-28 11:58 ` Srivatsa S. Bhat
2011-10-28 12:02 ` Rafael J. Wysocki
2011-10-28 12:28 ` Srivatsa S. Bhat
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=20111027134824.20916.46845.stgit@srivatsabhat.in.ibm.com \
--to=srivatsa.bhat@linux.vnet.ibm.com \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=ashok.raj@intel.com \
--cc=len.brown@intel.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=lucas.demarchi@profusion.mobi \
--cc=mingo@elte.hu \
--cc=pavel@ucw.cz \
--cc=rdunlap@xenotime.net \
--cc=rjw@sisk.pl \
--cc=rusty@rustcorp.com.au \
--cc=stern@rowland.harvard.edu \
--cc=suresh.b.siddha@intel.com \
--cc=vatsa@linux.vnet.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®