Commit afb90a36 authored by Leesoo Ahn's avatar Leesoo Ahn Committed by Andrew Morton

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.comSigned-off-by: default avatarLeesoo Ahn <lsahn@ooseel.net>
Acked-by: default avatarMike Rapoport (IBM) <rppt@kernel.org>
Reviewed-by: default avatarWei Yang <richard.weiyang@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 735ecdfa
...@@ -351,7 +351,7 @@ sparse_early_usemaps_alloc_pgdat_section(struct pglist_data *pgdat, ...@@ -351,7 +351,7 @@ sparse_early_usemaps_alloc_pgdat_section(struct pglist_data *pgdat,
again: again:
usage = memblock_alloc_try_nid(size, SMP_CACHE_BYTES, goal, limit, nid); usage = memblock_alloc_try_nid(size, SMP_CACHE_BYTES, goal, limit, nid);
if (!usage && limit) { if (!usage && limit) {
limit = 0; limit = MEMBLOCK_ALLOC_ACCESSIBLE;
goto again; goto again;
} }
return usage; return usage;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment