[lkml]   [2011]   [Oct]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subject[PATCH v4 0/2] CPU hotplug, Freezer: Fix race between CPU hotplug and freezer
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.

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.

v1 ->
v2 ->
v3 ->

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

 \ /
  Last update: 2011-10-27 15:51    [W:0.058 / U:1.684 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site