|
@@ -31,6 +31,7 @@
|
|
|
#include <linux/stop_machine.h>
|
|
|
#include <linux/hugetlb.h>
|
|
|
#include <linux/memblock.h>
|
|
|
+#include <linux/bootmem.h>
|
|
|
|
|
|
#include <asm/tlbflush.h>
|
|
|
|
|
@@ -1096,6 +1097,14 @@ static pg_data_t __ref *hotadd_new_pgdat(int nid, u64 start)
|
|
|
build_all_zonelists(pgdat, NULL);
|
|
|
mutex_unlock(&zonelists_mutex);
|
|
|
|
|
|
+ /*
|
|
|
+ * zone->managed_pages is set to an approximate value in
|
|
|
+ * free_area_init_core(), which will cause
|
|
|
+ * /sys/device/system/node/nodeX/meminfo has wrong data.
|
|
|
+ * So reset it to 0 before any memory is onlined.
|
|
|
+ */
|
|
|
+ reset_node_managed_pages(pgdat);
|
|
|
+
|
|
|
return pgdat;
|
|
|
}
|
|
|
|