diff options
author | Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com> | 2011-11-03 00:59:25 +0100 |
---|---|---|
committer | Xinyu Chen <xinyu.chen@freescale.com> | 2012-05-24 09:18:56 +0800 |
commit | ca8b250765cdc200ee5c2a53eaf0044891c3eda1 (patch) | |
tree | 092cce7ca8a8a4a3ffcd658384f1254fcb5dc83c /kernel/posix-timers.c | |
parent | 1066dc0b0e428ccf2f6ffacf5b15dc13a8f41b32 (diff) |
PM / Sleep: Fix race between CPU hotplug and freezer
The CPU hotplug notifications sent out by the _cpu_up() and _cpu_down()
functions depend on the value of the 'tasks_frozen' argument passed to them
(which indicates whether tasks have been frozen or not).
(Examples for such CPU hotplug notifications: 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.
Since the freezer is involved only in the Suspend/Hibernate call paths, this
patch hooks the CPU hotplug code to the suspend/hibernate notifiers
PM_[SUSPEND|HIBERNATE]_PREPARE and PM_POST_[SUSPEND|HIBERNATE] to prevent
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 indicate, _throughout_ their execution time.
Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'kernel/posix-timers.c')
0 files changed, 0 insertions, 0 deletions