]> git.baikalelectronics.ru Git - kernel.git/commit
mm/vmscan.c: use DIV_ROUND_UP for calculation of zone's balance_gap and correct comments.
authorJianyu Zhan <nasa4836@gmail.com>
Wed, 4 Jun 2014 23:10:38 +0000 (16:10 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 4 Jun 2014 23:54:11 +0000 (16:54 -0700)
commit9a573a2c986f6cffb9e1b62f6d873e53f4ca2d8b
tree7a438185cb78e2c6d3aec1e64960e64188cb4afe
parent21308c9b642bf984816c0010d08394d8d13c2a31
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>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/swap.h
mm/vmscan.c