diff options
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r-- | mm/page_alloc.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index ea77c999047e..813b4ec1298a 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -39,6 +39,7 @@ | |||
39 | #include <linux/mempolicy.h> | 39 | #include <linux/mempolicy.h> |
40 | 40 | ||
41 | #include <asm/tlbflush.h> | 41 | #include <asm/tlbflush.h> |
42 | #include <asm/div64.h> | ||
42 | #include "internal.h" | 43 | #include "internal.h" |
43 | 44 | ||
44 | /* | 45 | /* |
@@ -2566,9 +2567,11 @@ void setup_per_zone_pages_min(void) | |||
2566 | } | 2567 | } |
2567 | 2568 | ||
2568 | for_each_zone(zone) { | 2569 | for_each_zone(zone) { |
2569 | unsigned long tmp; | 2570 | u64 tmp; |
2571 | |||
2570 | spin_lock_irqsave(&zone->lru_lock, flags); | 2572 | spin_lock_irqsave(&zone->lru_lock, flags); |
2571 | tmp = (pages_min * zone->present_pages) / lowmem_pages; | 2573 | tmp = (u64)pages_min * zone->present_pages; |
2574 | do_div(tmp, lowmem_pages); | ||
2572 | if (is_highmem(zone)) { | 2575 | if (is_highmem(zone)) { |
2573 | /* | 2576 | /* |
2574 | * __GFP_HIGH and PF_MEMALLOC allocations usually don't | 2577 | * __GFP_HIGH and PF_MEMALLOC allocations usually don't |
@@ -2595,8 +2598,8 @@ void setup_per_zone_pages_min(void) | |||
2595 | zone->pages_min = tmp; | 2598 | zone->pages_min = tmp; |
2596 | } | 2599 | } |
2597 | 2600 | ||
2598 | zone->pages_low = zone->pages_min + tmp / 4; | 2601 | zone->pages_low = zone->pages_min + (tmp >> 2); |
2599 | zone->pages_high = zone->pages_min + tmp / 2; | 2602 | zone->pages_high = zone->pages_min + (tmp >> 1); |
2600 | spin_unlock_irqrestore(&zone->lru_lock, flags); | 2603 | spin_unlock_irqrestore(&zone->lru_lock, flags); |
2601 | } | 2604 | } |
2602 | 2605 | ||