[<prev] [next>] [day] [month] [year] [list]
Date: Tue, 5 May 2009 10:07:33 +0400
From: Cyrill Gorcunov <gorcunov@...nvz.org>
To: Andrew Morton <akpm@...ux-foundation.org>,
David Rientjes <rientjes@...gle.com>
Cc: LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH -mmotm] mm: setup_per_zone_inactive_ratio - do not call for
int_sqrt if not needed
int_sqrt returns 0 iif argument is zero so call it if only needed.
Signed-off-by: Cyrill Gorcunov <gorcunov@...nvz.org>
---
mm/page_alloc.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
Index: linux-2.6.git/mm/page_alloc.c
=====================================================================
--- linux-2.6.git.orig/mm/page_alloc.c
+++ linux-2.6.git/mm/page_alloc.c
@@ -4553,8 +4553,9 @@ static void setup_per_zone_inactive_rati
/* 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;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists