]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mm/vmscan.c: use DIV_ROUND_UP for calculation of zone's balance_gap and correct comments.
authorJianyu Zhan <nasa4836@gmail.com>
Thu, 22 May 2014 00:43:24 +0000 (10:43 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 22 May 2014 00:43:24 +0000 (10:43 +1000)
commitceb7a17f8bbf04bf8a7d1c8bb3a6f02c6032fba4
treea116dc9915a16b70106ab1545b92f263cd7cb24b
parent11db0233fdb6dd55f7629df10d59efbb323667a8
mm/vmscan.c: use DIV_ROUND_UP for calculation of zone's balance_gap and correct comments.

Currently, we use (zone->managed_pages + KSWAPD_ZONE_BALANCE_GAP_RATIO-1)
/ KSWAPD_ZONE_BALANCE_GAP_RATIO to avoid a zero gap value.  It's better to
use DIV_ROUND_UP macro for neater code and clear meaning.

Besides, the gap value is calculated against the per-zone "managed pages",
not "present pages".  This patch also corrects the comment and do some
rephrasing.

Signed-off-by: Jianyu Zhan <nasa4836@gmail.com>
Acked-by: Rik van Riel <riel@redhat.com>
Acked-by: Rafael Aquini <aquini@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/swap.h
mm/vmscan.c