[PATCH] memory hotadd: pgdat->node_present_pages fix
authorYasunori Goto <y-goto@jp.fujitsu.com>
Fri, 10 Mar 2006 01:33:51 +0000 (17:33 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 10 Mar 2006 03:47:38 +0000 (19:47 -0800)
When pages are onlined, not only zone->present_pages but also
pgdat->node_present_pages should be refreshed.

This parameter is used to show information at
/sys/device/system/node/nodeX/meminfo via si_meminfo_node().

So, it shows strange value for MemUsed which is calculated
(node_present_pages - all zones free pages).

Signed-off-by: Yasunori Goto <y-goto@jp.fujitsu.com>
Cc: Dave Hansen <haveblue@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
mm/memory_hotplug.c

index a918f77f02f3bb42bc4b11bab07e20ffd1773c5d..1fe76d963ac21a2d09d5d8cb8e21e687163202f1 100644 (file)
@@ -130,6 +130,7 @@ int online_pages(unsigned long pfn, unsigned long nr_pages)
                onlined_pages++;
        }
        zone->present_pages += onlined_pages;
+       zone->zone_pgdat->node_present_pages += onlined_pages;
 
        setup_per_zone_pages_min();