diff options
Diffstat (limited to 'mm/memory_hotplug.c')
-rw-r--r-- | mm/memory_hotplug.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index be211a582930..85eb4d342ac5 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c | |||
@@ -482,6 +482,29 @@ static void rollback_node_hotadd(int nid, pg_data_t *pgdat) | |||
482 | } | 482 | } |
483 | 483 | ||
484 | 484 | ||
485 | /* | ||
486 | * called by cpu_up() to online a node without onlined memory. | ||
487 | */ | ||
488 | int mem_online_node(int nid) | ||
489 | { | ||
490 | pg_data_t *pgdat; | ||
491 | int ret; | ||
492 | |||
493 | lock_system_sleep(); | ||
494 | pgdat = hotadd_new_pgdat(nid, 0); | ||
495 | if (pgdat) { | ||
496 | ret = -ENOMEM; | ||
497 | goto out; | ||
498 | } | ||
499 | node_set_online(nid); | ||
500 | ret = register_one_node(nid); | ||
501 | BUG_ON(ret); | ||
502 | |||
503 | out: | ||
504 | unlock_system_sleep(); | ||
505 | return ret; | ||
506 | } | ||
507 | |||
485 | /* we are OK calling __meminit stuff here - we have CONFIG_MEMORY_HOTPLUG */ | 508 | /* we are OK calling __meminit stuff here - we have CONFIG_MEMORY_HOTPLUG */ |
486 | int __ref add_memory(int nid, u64 start, u64 size) | 509 | int __ref add_memory(int nid, u64 start, u64 size) |
487 | { | 510 | { |