diff options
Diffstat (limited to 'mm/page_alloc.c')
| -rw-r--r-- | mm/page_alloc.c | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 1d6ba6a4b594..8d088371196a 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
| @@ -1061,20 +1061,19 @@ unsigned int nr_free_pages_pgdat(pg_data_t *pgdat) | |||
| 1061 | 1061 | ||
| 1062 | static unsigned int nr_free_zone_pages(int offset) | 1062 | static unsigned int nr_free_zone_pages(int offset) |
| 1063 | { | 1063 | { |
| 1064 | pg_data_t *pgdat; | 1064 | /* Just pick one node, since fallback list is circular */ |
| 1065 | pg_data_t *pgdat = NODE_DATA(numa_node_id()); | ||
| 1065 | unsigned int sum = 0; | 1066 | unsigned int sum = 0; |
| 1066 | 1067 | ||
| 1067 | for_each_pgdat(pgdat) { | 1068 | struct zonelist *zonelist = pgdat->node_zonelists + offset; |
| 1068 | struct zonelist *zonelist = pgdat->node_zonelists + offset; | 1069 | struct zone **zonep = zonelist->zones; |
| 1069 | struct zone **zonep = zonelist->zones; | 1070 | struct zone *zone; |
| 1070 | struct zone *zone; | ||
| 1071 | 1071 | ||
| 1072 | for (zone = *zonep++; zone; zone = *zonep++) { | 1072 | for (zone = *zonep++; zone; zone = *zonep++) { |
| 1073 | unsigned long size = zone->present_pages; | 1073 | unsigned long size = zone->present_pages; |
| 1074 | unsigned long high = zone->pages_high; | 1074 | unsigned long high = zone->pages_high; |
| 1075 | if (size > high) | 1075 | if (size > high) |
| 1076 | sum += size - high; | 1076 | sum += size - high; |
| 1077 | } | ||
| 1078 | } | 1077 | } |
| 1079 | 1078 | ||
| 1080 | return sum; | 1079 | return sum; |
| @@ -1861,7 +1860,6 @@ static void __init free_area_init_core(struct pglist_data *pgdat, | |||
| 1861 | unsigned long *zones_size, unsigned long *zholes_size) | 1860 | unsigned long *zones_size, unsigned long *zholes_size) |
| 1862 | { | 1861 | { |
| 1863 | unsigned long i, j; | 1862 | unsigned long i, j; |
| 1864 | const unsigned long zone_required_alignment = 1UL << (MAX_ORDER-1); | ||
| 1865 | int cpu, nid = pgdat->node_id; | 1863 | int cpu, nid = pgdat->node_id; |
| 1866 | unsigned long zone_start_pfn = pgdat->node_start_pfn; | 1864 | unsigned long zone_start_pfn = pgdat->node_start_pfn; |
| 1867 | 1865 | ||
| @@ -1934,9 +1932,6 @@ static void __init free_area_init_core(struct pglist_data *pgdat, | |||
| 1934 | zone->zone_mem_map = pfn_to_page(zone_start_pfn); | 1932 | zone->zone_mem_map = pfn_to_page(zone_start_pfn); |
| 1935 | zone->zone_start_pfn = zone_start_pfn; | 1933 | zone->zone_start_pfn = zone_start_pfn; |
| 1936 | 1934 | ||
| 1937 | if ((zone_start_pfn) & (zone_required_alignment-1)) | ||
| 1938 | printk(KERN_CRIT "BUG: wrong zone alignment, it will crash\n"); | ||
| 1939 | |||
| 1940 | memmap_init(size, nid, j, zone_start_pfn); | 1935 | memmap_init(size, nid, j, zone_start_pfn); |
| 1941 | 1936 | ||
| 1942 | zonetable_add(zone, nid, j, zone_start_pfn, size); | 1937 | zonetable_add(zone, nid, j, zone_start_pfn, size); |
