提交 5c87eada 编写于 作者: C Cyrill Gorcunov 提交者: Linus Torvalds

mm: setup_per_zone_inactive_ratio - do not call for int_sqrt if not needed

int_sqrt() returns 0 if its argument is zero so call it if only needed.
Signed-off-by: NCyrill Gorcunov <gorcunov@openvz.org>
Cc: David Rientjes <rientjes@google.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 af166777
......@@ -4471,8 +4471,9 @@ static void setup_per_zone_inactive_ratio(void)
/* Zone size in gigabytes */
gb = zone->present_pages >> (30 - PAGE_SHIFT);
ratio = int_sqrt(10 * gb);
if (!ratio)
if (gb)
ratio = int_sqrt(10 * gb);
else
ratio = 1;
zone->inactive_ratio = ratio;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册