aboutsummaryrefslogtreecommitdiffstats
path: root/mm/page_alloc.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2007-05-09 05:35:10 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-09 15:30:56 -0400
commit8bb7844286fb8c9fce6f65d8288aeb09d03a5e0d (patch)
treef4e305edaedbde05774bb1e4acd89a9475661d2e /mm/page_alloc.c
parentf37bc2712b54ec641e0c0c8634f1a4b61d9956c0 (diff)
Add suspend-related notifications for CPU hotplug
Since nonboot CPUs are now disabled after tasks and devices have been frozen and the CPU hotplug infrastructure is used for this purpose, we need special CPU hotplug notifications that will help the CPU-hotplug-aware subsystems distinguish normal CPU hotplug events from CPU hotplug events related to a system-wide suspend or resume operation in progress. This patch introduces such notifications and causes them to be used during suspend and resume transitions. It also changes all of the CPU-hotplug-aware subsystems to take these notifications into consideration (for now they are handled in the same way as the corresponding "normal" ones). [oleg@tv-sign.ru: cleanups] Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Cc: Gautham R Shenoy <ego@in.ibm.com> Cc: Pavel Machek <pavel@ucw.cz> Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r--mm/page_alloc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 6fd0b7455b0b..d53cbf8acb8e 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -2148,11 +2148,14 @@ static int __cpuinit pageset_cpuup_callback(struct notifier_block *nfb,
2148 2148
2149 switch (action) { 2149 switch (action) {
2150 case CPU_UP_PREPARE: 2150 case CPU_UP_PREPARE:
2151 case CPU_UP_PREPARE_FROZEN:
2151 if (process_zones(cpu)) 2152 if (process_zones(cpu))
2152 ret = NOTIFY_BAD; 2153 ret = NOTIFY_BAD;
2153 break; 2154 break;
2154 case CPU_UP_CANCELED: 2155 case CPU_UP_CANCELED:
2156 case CPU_UP_CANCELED_FROZEN:
2155 case CPU_DEAD: 2157 case CPU_DEAD:
2158 case CPU_DEAD_FROZEN:
2156 free_zone_pagesets(cpu); 2159 free_zone_pagesets(cpu);
2157 break; 2160 break;
2158 default: 2161 default:
@@ -3012,7 +3015,7 @@ static int page_alloc_cpu_notify(struct notifier_block *self,
3012{ 3015{
3013 int cpu = (unsigned long)hcpu; 3016 int cpu = (unsigned long)hcpu;
3014 3017
3015 if (action == CPU_DEAD) { 3018 if (action == CPU_DEAD || action == CPU_DEAD_FROZEN) {
3016 local_irq_disable(); 3019 local_irq_disable();
3017 __drain_pages(cpu); 3020 __drain_pages(cpu);
3018 vm_events_fold_cpu(cpu); 3021 vm_events_fold_cpu(cpu);