aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/cpu.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/cpu.c')
-rw-r--r--kernel/cpu.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/kernel/cpu.c b/kernel/cpu.c
index 545777574779..a3fbcc0a0abc 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -326,6 +326,12 @@ out_notify:
326int __cpuinit cpu_up(unsigned int cpu) 326int __cpuinit cpu_up(unsigned int cpu)
327{ 327{
328 int err = 0; 328 int err = 0;
329
330#ifdef CONFIG_MEMORY_HOTPLUG
331 int nid;
332 pg_data_t *pgdat;
333#endif
334
329 if (!cpu_possible(cpu)) { 335 if (!cpu_possible(cpu)) {
330 printk(KERN_ERR "can't online cpu %d because it is not " 336 printk(KERN_ERR "can't online cpu %d because it is not "
331 "configured as may-hotadd at boot time\n", cpu); 337 "configured as may-hotadd at boot time\n", cpu);
@@ -336,6 +342,25 @@ int __cpuinit cpu_up(unsigned int cpu)
336 return -EINVAL; 342 return -EINVAL;
337 } 343 }
338 344
345#ifdef CONFIG_MEMORY_HOTPLUG
346 nid = cpu_to_node(cpu);
347 if (!node_online(nid)) {
348 err = mem_online_node(nid);
349 if (err)
350 return err;
351 }
352
353 pgdat = NODE_DATA(nid);
354 if (!pgdat) {
355 printk(KERN_ERR
356 "Can't online cpu %d due to NULL pgdat\n", cpu);
357 return -ENOMEM;
358 }
359
360 if (pgdat->node_zonelists->_zonerefs->zone == NULL)
361 build_all_zonelists();
362#endif
363
339 cpu_maps_update_begin(); 364 cpu_maps_update_begin();
340 365
341 if (cpu_hotplug_disabled) { 366 if (cpu_hotplug_disabled) {