mm/sparse: use MEMBLOCK_ALLOC_ACCESSIBLE enum instead of 0
Subsystems (2)
PATCH v2 1/1 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.
---
v1 -> v2: do not rename 'limit' to 'limit_or_flag'
--- mm/sparse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/sparse.c +1 -1
@@ -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;
Signature · 1 line
2.34.1
Quoted 8 lines · Leesoo Ahn
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.
Signed-off-by Leesoo Ahn <[email protected]>
Quoted 22 lines
---
v1 -> v2: do not rename 'limit' to 'limit_or_flag'
---mm/sparse.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)mm/sparse.c +0
-0@@ -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) {mm/sparse.c +1
-1- limit =0 ; + limit =MEMBLOCK_ALLOC_ACCESSIBLE ;goto again; } return usage;Signature · 1 line
2.34.1
Signature · 2 lines
Wei Yang Help you, Help me
Quoted 8 lines · Leesoo Ahn
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.
Signed-off-by Leesoo Ahn <[email protected]>
Quoted 22 lines
---
v1 -> v2: do not rename 'limit' to 'limit_or_flag'--- mm/sparse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)mm/sparse.c +1
-1@@ -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;Signature · 1 line
2.34.1
Signature · 2 lines
Sincerely yours, Mike.