aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/node.c
diff options
context:
space:
mode:
authorNathan Fontenot <nfont@austin.ibm.com>2011-01-20 11:44:29 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2011-02-03 19:08:57 -0500
commitd33601644cd3b09afb2edd9474517edc441c8fad (patch)
tree1fc119bb30895d39d2dc9d1f738fb8d82c095ab1 /drivers/base/node.c
parent0c2c99b1b8ab5d294f176d631e945ebdefcce4cd (diff)
memory hotplug: Update phys_index to [start|end]_section_nr
Update the 'phys_index' property of a the memory_block struct to be called start_section_nr, and add a end_section_nr property. The data tracked here is the same but the updated naming is more in line with what is stored here, namely the first and last section number that the memory block spans. The names presented to userspace remain the same, phys_index for start_section_nr and end_phys_index for end_section_nr, to avoid breaking anything in userspace. This also updates the node sysfs code to be aware of the new capability for a memory block to contain multiple memory sections and be aware of the memory block structure name changes (start_section_nr). This requires an additional parameter to unregister_mem_sect_under_nodes so that we know which memory section of the memory block to unregister. Signed-off-by: Nathan Fontenot <nfont@austin.ibm.com> Reviewed-by: Robin Holt <holt@sgi.com> Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/base/node.c')
-rw-r--r--drivers/base/node.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/base/node.c b/drivers/base/node.c
index 36b43052001d..b3b72d64e805 100644
--- a/drivers/base/node.c
+++ b/drivers/base/node.c
@@ -375,8 +375,10 @@ int register_mem_sect_under_node(struct memory_block *mem_blk, int nid)
375 return -EFAULT; 375 return -EFAULT;
376 if (!node_online(nid)) 376 if (!node_online(nid))
377 return 0; 377 return 0;
378 sect_start_pfn = section_nr_to_pfn(mem_blk->phys_index); 378
379 sect_end_pfn = sect_start_pfn + PAGES_PER_SECTION - 1; 379 sect_start_pfn = section_nr_to_pfn(mem_blk->start_section_nr);
380 sect_end_pfn = section_nr_to_pfn(mem_blk->end_section_nr);
381 sect_end_pfn += PAGES_PER_SECTION - 1;
380 for (pfn = sect_start_pfn; pfn <= sect_end_pfn; pfn++) { 382 for (pfn = sect_start_pfn; pfn <= sect_end_pfn; pfn++) {
381 int page_nid; 383 int page_nid;
382 384
@@ -400,7 +402,8 @@ int register_mem_sect_under_node(struct memory_block *mem_blk, int nid)
400} 402}
401 403
402/* unregister memory section under all nodes that it spans */ 404/* unregister memory section under all nodes that it spans */
403int unregister_mem_sect_under_nodes(struct memory_block *mem_blk) 405int unregister_mem_sect_under_nodes(struct memory_block *mem_blk,
406 unsigned long phys_index)
404{ 407{
405 NODEMASK_ALLOC(nodemask_t, unlinked_nodes, GFP_KERNEL); 408 NODEMASK_ALLOC(nodemask_t, unlinked_nodes, GFP_KERNEL);
406 unsigned long pfn, sect_start_pfn, sect_end_pfn; 409 unsigned long pfn, sect_start_pfn, sect_end_pfn;
@@ -412,7 +415,8 @@ int unregister_mem_sect_under_nodes(struct memory_block *mem_blk)
412 if (!unlinked_nodes) 415 if (!unlinked_nodes)
413 return -ENOMEM; 416 return -ENOMEM;
414 nodes_clear(*unlinked_nodes); 417 nodes_clear(*unlinked_nodes);
415 sect_start_pfn = section_nr_to_pfn(mem_blk->phys_index); 418
419 sect_start_pfn = section_nr_to_pfn(phys_index);
416 sect_end_pfn = sect_start_pfn + PAGES_PER_SECTION - 1; 420 sect_end_pfn = sect_start_pfn + PAGES_PER_SECTION - 1;
417 for (pfn = sect_start_pfn; pfn <= sect_end_pfn; pfn++) { 421 for (pfn = sect_start_pfn; pfn <= sect_end_pfn; pfn++) {
418 int nid; 422 int nid;