diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 637f57ff5b5a1b55990bc4940492268601111c44..338a02bb004d3b3f37f49711ad05baaaa1e7d529 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -2702,8 +2702,7 @@ void *__init alloc_large_system_hash(const char *tablename,
 		else
 			numentries <<= (PAGE_SHIFT - scale);
 	}
-	/* rounded up to nearest power of 2 in size */
-	numentries = 1UL << (long_log2(numentries) + 1);
+	numentries = roundup_pow_of_two(numentries);
 
 	/* limit allocation size to 1/16 total memory by default */
 	if (max == 0) {