diff options
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r-- | mm/page_alloc.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 0cc5b3e198e5..07dfd89992fa 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -2080,14 +2080,35 @@ static void build_zonelist_cache(pg_data_t *pgdat) | |||
2080 | 2080 | ||
2081 | #endif /* CONFIG_NUMA */ | 2081 | #endif /* CONFIG_NUMA */ |
2082 | 2082 | ||
2083 | /* Any regular memory on that node ? */ | ||
2084 | static void check_for_regular_memory(pg_data_t *pgdat) | ||
2085 | { | ||
2086 | #ifdef CONFIG_HIGHMEM | ||
2087 | enum zone_type zone_type; | ||
2088 | |||
2089 | for (zone_type = 0; zone_type <= ZONE_NORMAL; zone_type++) { | ||
2090 | struct zone *zone = &pgdat->node_zones[zone_type]; | ||
2091 | if (zone->present_pages) | ||
2092 | node_set_state(zone_to_nid(zone), N_NORMAL_MEMORY); | ||
2093 | } | ||
2094 | #endif | ||
2095 | } | ||
2096 | |||
2083 | /* return values int ....just for stop_machine_run() */ | 2097 | /* return values int ....just for stop_machine_run() */ |
2084 | static int __build_all_zonelists(void *dummy) | 2098 | static int __build_all_zonelists(void *dummy) |
2085 | { | 2099 | { |
2086 | int nid; | 2100 | int nid; |
2087 | 2101 | ||
2088 | for_each_online_node(nid) { | 2102 | for_each_online_node(nid) { |
2089 | build_zonelists(NODE_DATA(nid)); | 2103 | pg_data_t *pgdat = NODE_DATA(nid); |
2090 | build_zonelist_cache(NODE_DATA(nid)); | 2104 | |
2105 | build_zonelists(pgdat); | ||
2106 | build_zonelist_cache(pgdat); | ||
2107 | |||
2108 | /* Any memory on that node */ | ||
2109 | if (pgdat->node_present_pages) | ||
2110 | node_set_state(nid, N_HIGH_MEMORY); | ||
2111 | check_for_regular_memory(pgdat); | ||
2091 | } | 2112 | } |
2092 | return 0; | 2113 | return 0; |
2093 | } | 2114 | } |