diff options
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r-- | mm/page_alloc.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 8c1a116875bc..a49f96b7ea43 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -711,6 +711,9 @@ static void __drain_pages(unsigned int cpu) | |||
711 | for_each_zone(zone) { | 711 | for_each_zone(zone) { |
712 | struct per_cpu_pageset *pset; | 712 | struct per_cpu_pageset *pset; |
713 | 713 | ||
714 | if (!populated_zone(zone)) | ||
715 | continue; | ||
716 | |||
714 | pset = zone_pcp(zone, cpu); | 717 | pset = zone_pcp(zone, cpu); |
715 | for (i = 0; i < ARRAY_SIZE(pset->pcp); i++) { | 718 | for (i = 0; i < ARRAY_SIZE(pset->pcp); i++) { |
716 | struct per_cpu_pages *pcp; | 719 | struct per_cpu_pages *pcp; |
@@ -3321,6 +3324,10 @@ void *__init alloc_large_system_hash(const char *tablename, | |||
3321 | numentries >>= (scale - PAGE_SHIFT); | 3324 | numentries >>= (scale - PAGE_SHIFT); |
3322 | else | 3325 | else |
3323 | numentries <<= (PAGE_SHIFT - scale); | 3326 | numentries <<= (PAGE_SHIFT - scale); |
3327 | |||
3328 | /* Make sure we've got at least a 0-order allocation.. */ | ||
3329 | if (unlikely((numentries * bucketsize) < PAGE_SIZE)) | ||
3330 | numentries = PAGE_SIZE / bucketsize; | ||
3324 | } | 3331 | } |
3325 | numentries = roundup_pow_of_two(numentries); | 3332 | numentries = roundup_pow_of_two(numentries); |
3326 | 3333 | ||