Commit a1e565aa authored by Committed by Linus TorvaldsBrowse files
memory-hotplug: do not allocate pgdat if it was not freed when offline.
Since there is no way to guarentee the address of pgdat/zone is not on stack of any kernel threads or used by other kernel objects without reference counting or other symchronizing method, we cannot reset node_data and free pgdat when offlining a node. Just reset pgdat to 0 and reuse the memory when the node is online again. The problem is suggested by Kamezawa Hiroyuki. The idea is from Wen Congyang. NOTE: If we don't reset pgdat to 0, the WARN_ON in free_area_init_node() will be triggered. [firstname.lastname@example.org: fix warning when CONFIG_NEED_MULTIPLE_NODES=n] [email@example.com: fix the warning again again] Signed-off-by: Tang Chen <firstname.lastname@example.org> Reviewed-by: Wen Congyang <email@example.com> Cc: KOSAKI Motohiro <firstname.lastname@example.org> Cc: Jiang Liu <email@example.com> Cc: Jianguo Wu <firstname.lastname@example.org> Cc: Kamezawa Hiroyuki <email@example.com> Cc: Lai Jiangshan <firstname.lastname@example.org> Cc: Wu Jianguo <email@example.com> Cc: Yasuaki Ishimatsu <firstname.lastname@example.org> Cc: Ingo Molnar <email@example.com> Cc: Thomas Gleixner <firstname.lastname@example.org> Cc: "H. Peter Anvin" <email@example.com> Signed-off-by: Andrew Morton <firstname.lastname@example.org> Signed-off-by: Linus Torvalds <email@example.com>
Showing with 16 additions and 8 deletions