diff options
Diffstat (limited to 'mm')
-rw-r--r-- | mm/page_alloc.c | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 9a2fa8110afc..a51ef94eec33 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -78,21 +78,37 @@ int min_free_kbytes = 1024; | |||
78 | unsigned long __initdata nr_kernel_pages; | 78 | unsigned long __initdata nr_kernel_pages; |
79 | unsigned long __initdata nr_all_pages; | 79 | unsigned long __initdata nr_all_pages; |
80 | 80 | ||
81 | /* | 81 | static int page_outside_zone_boundaries(struct zone *zone, struct page *page) |
82 | * Temporary debugging check for pages not lying within a given zone. | ||
83 | */ | ||
84 | static int bad_range(struct zone *zone, struct page *page) | ||
85 | { | 82 | { |
86 | if (page_to_pfn(page) >= zone->zone_start_pfn + zone->spanned_pages) | 83 | if (page_to_pfn(page) >= zone->zone_start_pfn + zone->spanned_pages) |
87 | return 1; | 84 | return 1; |
88 | if (page_to_pfn(page) < zone->zone_start_pfn) | 85 | if (page_to_pfn(page) < zone->zone_start_pfn) |
89 | return 1; | 86 | return 1; |
87 | |||
88 | return 0; | ||
89 | } | ||
90 | |||
91 | static int page_is_consistent(struct zone *zone, struct page *page) | ||
92 | { | ||
90 | #ifdef CONFIG_HOLES_IN_ZONE | 93 | #ifdef CONFIG_HOLES_IN_ZONE |
91 | if (!pfn_valid(page_to_pfn(page))) | 94 | if (!pfn_valid(page_to_pfn(page))) |
92 | return 1; | 95 | return 0; |
93 | #endif | 96 | #endif |
94 | if (zone != page_zone(page)) | 97 | if (zone != page_zone(page)) |
98 | return 0; | ||
99 | |||
100 | return 1; | ||
101 | } | ||
102 | /* | ||
103 | * Temporary debugging check for pages not lying within a given zone. | ||
104 | */ | ||
105 | static int bad_range(struct zone *zone, struct page *page) | ||
106 | { | ||
107 | if (page_outside_zone_boundaries(zone, page)) | ||
95 | return 1; | 108 | return 1; |
109 | if (!page_is_consistent(zone, page)) | ||
110 | return 1; | ||
111 | |||
96 | return 0; | 112 | return 0; |
97 | } | 113 | } |
98 | 114 | ||