Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5c87eada authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Linus Torvalds
Browse files

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: default avatarCyrill Gorcunov <gorcunov@openvz.org>
Cc: David Rientjes <rientjes@google.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent af166777
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -4471,8 +4471,9 @@ static void setup_per_zone_inactive_ratio(void)

		/* Zone size in gigabytes */
		gb = zone->present_pages >> (30 - PAGE_SHIFT);
		if (gb)
			ratio = int_sqrt(10 * gb);
		if (!ratio)
		else
			ratio = 1;

		zone->inactive_ratio = ratio;