Skip to content

Commit 2a4814d

Browse files
committed
sparc: Use HAVE_MEMBLOCK_NODE_MAP
sparc doesn't access early_node_map[] directly and enabling HAVE_MEMBLOCK_NODE_MAP is trivial - replacing add_active_range() calls with memblock_set_node() and selecting HAVE_MEMBLOCK_NODE_MAP is enough. -v2: Use select in Kconfig instead as suggested by Sam Ravnborg. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: "David S. Miller" <davem@davemloft.net> Cc: Sam Ravnborg <sam@ravnborg.org> Cc: sparclinux@vger.kernel.org
1 parent 1d7cfe1 commit 2a4814d

2 files changed

Lines changed: 5 additions & 20 deletions

File tree

‎arch/sparc/Kconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ config SPARC64
4343
select HAVE_KPROBES
4444
select HAVE_RCU_TABLE_FREE if SMP
4545
select HAVE_MEMBLOCK
46+
select HAVE_MEMBLOCK_NODE_MAP
4647
select HAVE_SYSCALL_WRAPPERS
4748
select HAVE_DYNAMIC_FTRACE
4849
select HAVE_FTRACE_MCOUNT_RECORD

‎arch/sparc/mm/init_64.c‎

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,7 @@ static u64 memblock_nid_range(u64 start, u64 end, int *nid)
816816
#endif
817817

818818
/* This must be invoked after performing all of the necessary
819-
* add_active_range() calls for 'nid'. We need to be able to get
819+
* memblock_set_node() calls for 'nid'. We need to be able to get
820820
* correct data from get_pfn_range_for_nid().
821821
*/
822822
static void __init allocate_node_data(int nid)
@@ -987,14 +987,11 @@ static void __init add_node_ranges(void)
987987

988988
this_end = memblock_nid_range(start, end, &nid);
989989

990-
numadbg("Adding active range nid[%d] "
990+
numadbg("Setting memblock NUMA node nid[%d] "
991991
"start[%lx] end[%lx]\n",
992992
nid, start, this_end);
993993

994-
add_active_range(nid,
995-
start >> PAGE_SHIFT,
996-
this_end >> PAGE_SHIFT);
997-
994+
memblock_set_node(start, this_end - start, nid);
998995
start = this_end;
999996
}
1000997
}
@@ -1282,7 +1279,6 @@ static void __init bootmem_init_nonnuma(void)
12821279
{
12831280
unsigned long top_of_ram = memblock_end_of_DRAM();
12841281
unsigned long total_ram = memblock_phys_mem_size();
1285-
struct memblock_region *reg;
12861282

12871283
numadbg("bootmem_init_nonnuma()\n");
12881284

@@ -1292,20 +1288,8 @@ static void __init bootmem_init_nonnuma(void)
12921288
(top_of_ram - total_ram) >> 20);
12931289

12941290
init_node_masks_nonnuma();
1295-
1296-
for_each_memblock(memory, reg) {
1297-
unsigned long start_pfn, end_pfn;
1298-
1299-
if (!reg->size)
1300-
continue;
1301-
1302-
start_pfn = memblock_region_memory_base_pfn(reg);
1303-
end_pfn = memblock_region_memory_end_pfn(reg);
1304-
add_active_range(0, start_pfn, end_pfn);
1305-
}
1306-
1291+
memblock_set_node(0, (phys_addr_t)ULLONG_MAX, 0);
13071292
allocate_node_data(0);
1308-
13091293
node_set_online(0);
13101294
}
13111295

0 commit comments

Comments
 (0)