linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/2] CPU hotplug, Freezer: Fix race between CPU hotplug and freezer
@ 2011-10-27 13:48 Srivatsa S. Bhat
  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
  0 siblings, 2 replies; 9+ messages in thread
From: Srivatsa S. Bhat @ 2011-10-27 13:48 UTC (permalink / raw)
  Cc: a.p.zijlstra, rjw, stern, pavel, len.brown, mingo, akpm,
	suresh.b.siddha, lucas.demarchi, linux-pm, rusty, vatsa,
	ashok.raj, linux-kernel, linux-doc, rdunlap

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(-)



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-10-28 12:28 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-27 13:48 [PATCH v4 0/2] CPU hotplug, Freezer: Fix race between CPU hotplug and freezer Srivatsa S. Bhat
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).