All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -mmotm] mm: setup_per_zone_inactive_ratio - do not call for int_sqrt if not needed
@ 2009-05-05  6:07 Cyrill Gorcunov
  0 siblings, 0 replies; only message in thread
From: Cyrill Gorcunov @ 2009-05-05  6:07 UTC (permalink / raw)
  To: Andrew Morton, David Rientjes; +Cc: LKML

int_sqrt returns 0 iif argument is zero so call it if only needed.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.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;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-05-05  6:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-05  6:07 [PATCH -mmotm] mm: setup_per_zone_inactive_ratio - do not call for int_sqrt if not needed Cyrill Gorcunov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.