aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorYasunori Goto <y-goto@jp.fujitsu.com>2006-06-27 05:53:38 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-27 20:32:36 -0400
commitae5a2c1c9b2bc3633032f97d02e60ae547a6047c (patch)
tree51244762aca6ff087d4934f184c3877888b198c3 /arch
parent0fc44159bfcb5b0afa178f9c3f50db23aebc76ff (diff)
[PATCH] pgdat allocation and update for ia64 of memory hotplug: hold pgdat address at system running
This is a preparatory patch to make common code for updating of NODE_DATA() of ia64 between boottime and hotplug. Current code remembers pgdat address in mem_data which is used at just boot time. But its information can be used at hotplug time by moving to global value. The next patch uses this array. Signed-off-by: Yasunori Goto <y-goto@jp.fujitsu.com> Cc: "Luck, Tony" <tony.luck@intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/ia64/mm/discontig.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/arch/ia64/mm/discontig.c b/arch/ia64/mm/discontig.c
index b6bcc9fa3603..83153ac18795 100644
--- a/arch/ia64/mm/discontig.c
+++ b/arch/ia64/mm/discontig.c
@@ -33,7 +33,6 @@
33 */ 33 */
34struct early_node_data { 34struct early_node_data {
35 struct ia64_node_data *node_data; 35 struct ia64_node_data *node_data;
36 pg_data_t *pgdat;
37 unsigned long pernode_addr; 36 unsigned long pernode_addr;
38 unsigned long pernode_size; 37 unsigned long pernode_size;
39 struct bootmem_data bootmem_data; 38 struct bootmem_data bootmem_data;
@@ -46,6 +45,8 @@ struct early_node_data {
46static struct early_node_data mem_data[MAX_NUMNODES] __initdata; 45static struct early_node_data mem_data[MAX_NUMNODES] __initdata;
47static nodemask_t memory_less_mask __initdata; 46static nodemask_t memory_less_mask __initdata;
48 47
48static pg_data_t *pgdat_list[MAX_NUMNODES];
49
49/* 50/*
50 * To prevent cache aliasing effects, align per-node structures so that they 51 * To prevent cache aliasing effects, align per-node structures so that they
51 * start at addresses that are strided by node number. 52 * start at addresses that are strided by node number.
@@ -175,13 +176,13 @@ static void __init fill_pernode(int node, unsigned long pernode,
175 pernode += PERCPU_PAGE_SIZE * cpus; 176 pernode += PERCPU_PAGE_SIZE * cpus;
176 pernode += node * L1_CACHE_BYTES; 177 pernode += node * L1_CACHE_BYTES;
177 178
178 mem_data[node].pgdat = __va(pernode); 179 pgdat_list[node] = __va(pernode);
179 pernode += L1_CACHE_ALIGN(sizeof(pg_data_t)); 180 pernode += L1_CACHE_ALIGN(sizeof(pg_data_t));
180 181
181 mem_data[node].node_data = __va(pernode); 182 mem_data[node].node_data = __va(pernode);
182 pernode += L1_CACHE_ALIGN(sizeof(struct ia64_node_data)); 183 pernode += L1_CACHE_ALIGN(sizeof(struct ia64_node_data));
183 184
184 mem_data[node].pgdat->bdata = bdp; 185 pgdat_list[node]->bdata = bdp;
185 pernode += L1_CACHE_ALIGN(sizeof(pg_data_t)); 186 pernode += L1_CACHE_ALIGN(sizeof(pg_data_t));
186 187
187 cpu_data = per_cpu_node_setup(cpu_data, node); 188 cpu_data = per_cpu_node_setup(cpu_data, node);
@@ -268,7 +269,7 @@ static int __init find_pernode_space(unsigned long start, unsigned long len,
268static int __init free_node_bootmem(unsigned long start, unsigned long len, 269static int __init free_node_bootmem(unsigned long start, unsigned long len,
269 int node) 270 int node)
270{ 271{
271 free_bootmem_node(mem_data[node].pgdat, start, len); 272 free_bootmem_node(pgdat_list[node], start, len);
272 273
273 return 0; 274 return 0;
274} 275}
@@ -287,7 +288,7 @@ static void __init reserve_pernode_space(void)
287 int node; 288 int node;
288 289
289 for_each_online_node(node) { 290 for_each_online_node(node) {
290 pg_data_t *pdp = mem_data[node].pgdat; 291 pg_data_t *pdp = pgdat_list[node];
291 292
292 if (node_isset(node, memory_less_mask)) 293 if (node_isset(node, memory_less_mask))
293 continue; 294 continue;
@@ -317,12 +318,8 @@ static void __init reserve_pernode_space(void)
317 */ 318 */
318static void __init initialize_pernode_data(void) 319static void __init initialize_pernode_data(void)
319{ 320{
320 pg_data_t *pgdat_list[MAX_NUMNODES];
321 int cpu, node; 321 int cpu, node;
322 322
323 for_each_online_node(node)
324 pgdat_list[node] = mem_data[node].pgdat;
325
326 /* Copy the pg_data_t list to each node and init the node field */ 323 /* Copy the pg_data_t list to each node and init the node field */
327 for_each_online_node(node) { 324 for_each_online_node(node) {
328 memcpy(mem_data[node].node_data->pg_data_ptrs, pgdat_list, 325 memcpy(mem_data[node].node_data->pg_data_ptrs, pgdat_list,
@@ -372,7 +369,7 @@ static void __init *memory_less_node_alloc(int nid, unsigned long pernodesize)
372 if (bestnode == -1) 369 if (bestnode == -1)
373 bestnode = anynode; 370 bestnode = anynode;
374 371
375 ptr = __alloc_bootmem_node(mem_data[bestnode].pgdat, pernodesize, 372 ptr = __alloc_bootmem_node(pgdat_list[bestnode], pernodesize,
376 PERCPU_PAGE_SIZE, __pa(MAX_DMA_ADDRESS)); 373 PERCPU_PAGE_SIZE, __pa(MAX_DMA_ADDRESS));
377 374
378 return ptr; 375 return ptr;
@@ -476,7 +473,7 @@ void __init find_memory(void)
476 pernodesize = mem_data[node].pernode_size; 473 pernodesize = mem_data[node].pernode_size;
477 map = pernode + pernodesize; 474 map = pernode + pernodesize;
478 475
479 init_bootmem_node(mem_data[node].pgdat, 476 init_bootmem_node(pgdat_list[node],
480 map>>PAGE_SHIFT, 477 map>>PAGE_SHIFT,
481 bdp->node_boot_start>>PAGE_SHIFT, 478 bdp->node_boot_start>>PAGE_SHIFT,
482 bdp->node_low_pfn); 479 bdp->node_low_pfn);