From: Leesoo Ahn Date: Mon, 10 Jun 2024 15:15:28 +0000 (+0900) Subject: mm/sparse: use MEMBLOCK_ALLOC_ACCESSIBLE enum instead of 0 X-Git-Tag: v6.11-rc1~85^2~295 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=afb90a36c643112bc8cabefb71c110ee2b757ca3;p=thirdparty%2Fkernel%2Flinux.git mm/sparse: use MEMBLOCK_ALLOC_ACCESSIBLE enum instead of 0 Setting 'limit' variable to 0 might seem like it means "no limit". But in the memblock API, 0 actually means the 'MEMBLOCK_ALLOC_ACCESSIBLE' enum, which limits the physical address range end based on 'memblock.current_limit'. This could be confusing. Use the enum instead of 0 to make it clear. Link: https://lkml.kernel.org/r/20240610151528.943680-1-lsahn@wewakecorp.com Signed-off-by: Leesoo Ahn Acked-by: Mike Rapoport (IBM) Reviewed-by: Wei Yang Signed-off-by: Andrew Morton --- diff --git a/mm/sparse.c b/mm/sparse.c index 731f781e91b60..0c64db3f49a6b 100644 --- a/mm/sparse.c +++ b/mm/sparse.c @@ -351,7 +351,7 @@ sparse_early_usemaps_alloc_pgdat_section(struct pglist_data *pgdat, again: usage = memblock_alloc_try_nid(size, SMP_CACHE_BYTES, goal, limit, nid); if (!usage && limit) { - limit = 0; + limit = MEMBLOCK_ALLOC_ACCESSIBLE; goto again; } return usage;