Skip to content

Commit 3571761

Browse files
hkamezawaLinus Torvalds
authored and
Linus Torvalds
committed
[PATCH] for_each_online_pgdat: remove sorting pgdat
Because pgdat_list was linked to pgdat_list in *reverse* order, (By default) some of arch has to sort it by themselves. for_each_pgdat has gone..for_each_online_pgdat() uses node_online_map, which doesn't need to be sorted. This patch removes codes for sorting pgdat. Signed-off-by: KAMEZAWA Hiroyuki <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent ec936fc commit 3571761

File tree

3 files changed

+0
-48
lines changed

3 files changed

+0
-48
lines changed

arch/i386/mm/discontig.c

-11
Original file line numberDiff line numberDiff line change
@@ -352,17 +352,6 @@ void __init zone_sizes_init(void)
352352
{
353353
int nid;
354354

355-
/*
356-
* Insert nodes into pgdat_list backward so they appear in order.
357-
* Clobber node 0's links and NULL out pgdat_list before starting.
358-
*/
359-
pgdat_list = NULL;
360-
for (nid = MAX_NUMNODES - 1; nid >= 0; nid--) {
361-
if (!node_online(nid))
362-
continue;
363-
NODE_DATA(nid)->pgdat_next = pgdat_list;
364-
pgdat_list = NODE_DATA(nid);
365-
}
366355

367356
for_each_online_node(nid) {
368357
unsigned long zones_size[MAX_NR_ZONES] = {0, 0, 0};

arch/ia64/mm/discontig.c

-31
Original file line numberDiff line numberDiff line change
@@ -378,31 +378,6 @@ static void __init *memory_less_node_alloc(int nid, unsigned long pernodesize)
378378
return ptr;
379379
}
380380

381-
/**
382-
* pgdat_insert - insert the pgdat into global pgdat_list
383-
* @pgdat: the pgdat for a node.
384-
*/
385-
static void __init pgdat_insert(pg_data_t *pgdat)
386-
{
387-
pg_data_t *prev = NULL, *next;
388-
389-
for_each_online_pgdat(next)
390-
if (pgdat->node_id < next->node_id)
391-
break;
392-
else
393-
prev = next;
394-
395-
if (prev) {
396-
prev->pgdat_next = pgdat;
397-
pgdat->pgdat_next = next;
398-
} else {
399-
pgdat->pgdat_next = pgdat_list;
400-
pgdat_list = pgdat;
401-
}
402-
403-
return;
404-
}
405-
406381
/**
407382
* memory_less_nodes - allocate and initialize CPU only nodes pernode
408383
* information.
@@ -745,11 +720,5 @@ void __init paging_init(void)
745720
pfn_offset, zholes_size);
746721
}
747722

748-
/*
749-
* Make memory less nodes become a member of the known nodes.
750-
*/
751-
for_each_node_mask(node, memory_less_mask)
752-
pgdat_insert(mem_data[node].pgdat);
753-
754723
zero_page_memmap_ptr = virt_to_page(ia64_imva(empty_zero_page));
755724
}

arch/m32r/mm/discontig.c

-6
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,6 @@ unsigned long __init zone_sizes_init(void)
137137
int nid, i;
138138
mem_prof_t *mp;
139139

140-
pgdat_list = NULL;
141-
for (nid = num_online_nodes() - 1 ; nid >= 0 ; nid--) {
142-
NODE_DATA(nid)->pgdat_next = pgdat_list;
143-
pgdat_list = NODE_DATA(nid);
144-
}
145-
146140
for_each_online_node(nid) {
147141
mp = &mem_prof[nid];
148142
for (i = 0 ; i < MAX_NR_ZONES ; i++) {

0 commit comments

Comments
 (0)