]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - mm/page_alloc.c
Memoryless nodes: introduce mask of nodes with memory
[linux-2.6-omap-h63xx.git] / mm / page_alloc.c
index 0cc5b3e198e5e2ccab5b97846e80a1894f20ccca..07dfd89992fa6d0ee90cf0ca6646a43d7dd926e2 100644 (file)
@@ -2080,14 +2080,35 @@ static void build_zonelist_cache(pg_data_t *pgdat)
 
 #endif /* CONFIG_NUMA */
 
+/* Any regular memory on that node ? */
+static void check_for_regular_memory(pg_data_t *pgdat)
+{
+#ifdef CONFIG_HIGHMEM
+       enum zone_type zone_type;
+
+       for (zone_type = 0; zone_type <= ZONE_NORMAL; zone_type++) {
+               struct zone *zone = &pgdat->node_zones[zone_type];
+               if (zone->present_pages)
+                       node_set_state(zone_to_nid(zone), N_NORMAL_MEMORY);
+       }
+#endif
+}
+
 /* return values int ....just for stop_machine_run() */
 static int __build_all_zonelists(void *dummy)
 {
        int nid;
 
        for_each_online_node(nid) {
-               build_zonelists(NODE_DATA(nid));
-               build_zonelist_cache(NODE_DATA(nid));
+               pg_data_t *pgdat = NODE_DATA(nid);
+
+               build_zonelists(pgdat);
+               build_zonelist_cache(pgdat);
+
+               /* Any memory on that node */
+               if (pgdat->node_present_pages)
+                       node_set_state(nid, N_HIGH_MEMORY);
+               check_for_regular_memory(pgdat);
        }
        return 0;
 }