mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-26 12:40:54 +07:00
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>
This commit is contained in:
parent
af166777cf
commit
5c87eada68
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user