diff options
author | Andrew Morton <[email protected]> | 2013-02-22 16:32:22 -0800 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2013-02-23 17:50:10 -0800 |
commit | 90ae8d670c12156f4328235aca1a528a8bfe6708 (patch) | |
tree | 91f1556b416397b8119c9884fe81fe24f451b9b9 | |
parent | af34770e55fd899c96d8d73bdc04dbc956096650 (diff) |
mm/page_alloc.c:__setup_per_zone_wmarks: make min_pages unsigned long
`int' is an inappropriate type for a number-of-pages counter.
While we're there, use the clamp() macro.
Acked-by: Johannes Weiner <[email protected]>
Cc: Rik van Riel <[email protected]>
Cc: Mel Gorman <[email protected]>
Reviewed-by: Michal Hocko <[email protected]>
Cc: Hugh Dickins <[email protected]>
Cc: Satoru Moriya <[email protected]>
Cc: Simon Jeons <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r-- | mm/page_alloc.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 804cc62ab72f..703944809666 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -5247,13 +5247,10 @@ static void __setup_per_zone_wmarks(void) * deltas controls asynch page reclaim, and so should * not be capped for highmem. */ - int min_pages; + unsigned long min_pages; min_pages = zone->present_pages / 1024; - if (min_pages < SWAP_CLUSTER_MAX) - min_pages = SWAP_CLUSTER_MAX; - if (min_pages > 128) - min_pages = 128; + min_pages = clamp(min_pages, SWAP_CLUSTER_MAX, 128UL); zone->watermark[WMARK_MIN] = min_pages; } else { /* |