summaryrefslogtreecommitdiffstats
path: root/mm/page_alloc.c
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@openvz.org>2009-06-17 00:32:32 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-17 04:47:39 +0200
commit5c87eada68fe5d29a5f67528f81b6e45124f579b (patch)
tree11088d75bd2132fecf70e402d4334686461aba7c /mm/page_alloc.c
parentvmscan: ZVC updates in shrink_active_list() can be done once (diff)
downloadlinux-5c87eada68fe5d29a5f67528f81b6e45124f579b.tar.xz
linux-5c87eada68fe5d29a5f67528f81b6e45124f579b.zip
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: Cyrill Gorcunov <gorcunov@openvz.org> Cc: David Rientjes <rientjes@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to '')
-rw-r--r--mm/page_alloc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index e5b8f628d166..db8c46ffa9f5 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -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;