diff options
| author | Leesoo Ahn <[email protected]> | 2024-06-10 15:15:28 +0000 |
|---|---|---|
| committer | Andrew Morton <[email protected]> | 2024-07-04 02:30:08 +0000 |
| commit | afb90a36c643112bc8cabefb71c110ee2b757ca3 (patch) | |
| tree | 18aa1a1a53eab0ffac62db798564b47c066ae9af | |
| parent | mm/vmscan: avoid split lazyfree THP during shrink_folio_list() (diff) | |
| download | kernel-afb90a36c643112bc8cabefb71c110ee2b757ca3.tar.gz kernel-afb90a36c643112bc8cabefb71c110ee2b757ca3.zip | |
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/[email protected]
Signed-off-by: Leesoo Ahn <[email protected]>
Acked-by: Mike Rapoport (IBM) <[email protected]>
Reviewed-by: Wei Yang <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
| -rw-r--r-- | mm/sparse.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/sparse.c b/mm/sparse.c index 731f781e91b6..0c64db3f49a6 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; |
