diff options
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r-- | mm/page_alloc.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 0027d8f4a1bb..a13ded1938f0 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -5236,6 +5236,7 @@ void *__init alloc_large_system_hash(const char *tablename, | |||
5236 | max = ((unsigned long long)nr_all_pages << PAGE_SHIFT) >> 4; | 5236 | max = ((unsigned long long)nr_all_pages << PAGE_SHIFT) >> 4; |
5237 | do_div(max, bucketsize); | 5237 | do_div(max, bucketsize); |
5238 | } | 5238 | } |
5239 | max = min(max, 0x80000000ULL); | ||
5239 | 5240 | ||
5240 | if (numentries > max) | 5241 | if (numentries > max) |
5241 | numentries = max; | 5242 | numentries = max; |
@@ -5413,7 +5414,25 @@ __count_immobile_pages(struct zone *zone, struct page *page, int count) | |||
5413 | 5414 | ||
5414 | bool is_pageblock_removable_nolock(struct page *page) | 5415 | bool is_pageblock_removable_nolock(struct page *page) |
5415 | { | 5416 | { |
5416 | struct zone *zone = page_zone(page); | 5417 | struct zone *zone; |
5418 | unsigned long pfn; | ||
5419 | |||
5420 | /* | ||
5421 | * We have to be careful here because we are iterating over memory | ||
5422 | * sections which are not zone aware so we might end up outside of | ||
5423 | * the zone but still within the section. | ||
5424 | * We have to take care about the node as well. If the node is offline | ||
5425 | * its NODE_DATA will be NULL - see page_zone. | ||
5426 | */ | ||
5427 | if (!node_online(page_to_nid(page))) | ||
5428 | return false; | ||
5429 | |||
5430 | zone = page_zone(page); | ||
5431 | pfn = page_to_pfn(page); | ||
5432 | if (zone->zone_start_pfn > pfn || | ||
5433 | zone->zone_start_pfn + zone->spanned_pages <= pfn) | ||
5434 | return false; | ||
5435 | |||
5417 | return __count_immobile_pages(zone, page, 0); | 5436 | return __count_immobile_pages(zone, page, 0); |
5418 | } | 5437 | } |
5419 | 5438 | ||