diff options
author | Robin Holt <holt@sgi.com> | 2010-09-29 15:00:56 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-10-22 13:16:44 -0400 |
commit | 63d027a63888e993545d10fdfe4107d543f01bca (patch) | |
tree | 223e4f3905c1519625e3973d8f25482c1f86b94f | |
parent | 98383031ed77c6eb49ab612166fef9c0efe1604a (diff) |
driver core: Convert link_mem_sections to use find_memory_block_hinted.
Modify link_mem_sections() to pass in the previous mem_block as a hint to
locating the next mem_block. Since they are typically added in order this
results in a massive saving in time during boot of a very large system.
For example, on a 16TB x86_64 machine, it reduced the total time spent
linking all node's memory sections from 1 hour, 27 minutes to 46 seconds.
Signed-off-by: Robin Holt <holt@sgi.com>
To: Gary Hade <garyhade@us.ibm.com>
To: Badari Pulavarty <pbadari@us.ibm.com>
To: Ingo Molnar <mingo@elte.hu>
Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/base/node.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/base/node.c b/drivers/base/node.c index 2872e86837b2..ee53558b452f 100644 --- a/drivers/base/node.c +++ b/drivers/base/node.c | |||
@@ -409,25 +409,27 @@ static int link_mem_sections(int nid) | |||
409 | unsigned long start_pfn = NODE_DATA(nid)->node_start_pfn; | 409 | unsigned long start_pfn = NODE_DATA(nid)->node_start_pfn; |
410 | unsigned long end_pfn = start_pfn + NODE_DATA(nid)->node_spanned_pages; | 410 | unsigned long end_pfn = start_pfn + NODE_DATA(nid)->node_spanned_pages; |
411 | unsigned long pfn; | 411 | unsigned long pfn; |
412 | struct memory_block *mem_blk = NULL; | ||
412 | int err = 0; | 413 | int err = 0; |
413 | 414 | ||
414 | for (pfn = start_pfn; pfn < end_pfn; pfn += PAGES_PER_SECTION) { | 415 | for (pfn = start_pfn; pfn < end_pfn; pfn += PAGES_PER_SECTION) { |
415 | unsigned long section_nr = pfn_to_section_nr(pfn); | 416 | unsigned long section_nr = pfn_to_section_nr(pfn); |
416 | struct mem_section *mem_sect; | 417 | struct mem_section *mem_sect; |
417 | struct memory_block *mem_blk; | ||
418 | int ret; | 418 | int ret; |
419 | 419 | ||
420 | if (!present_section_nr(section_nr)) | 420 | if (!present_section_nr(section_nr)) |
421 | continue; | 421 | continue; |
422 | mem_sect = __nr_to_section(section_nr); | 422 | mem_sect = __nr_to_section(section_nr); |
423 | mem_blk = find_memory_block(mem_sect); | 423 | mem_blk = find_memory_block_hinted(mem_sect, mem_blk); |
424 | ret = register_mem_sect_under_node(mem_blk, nid); | 424 | ret = register_mem_sect_under_node(mem_blk, nid); |
425 | if (!err) | 425 | if (!err) |
426 | err = ret; | 426 | err = ret; |
427 | 427 | ||
428 | /* discard ref obtained in find_memory_block() */ | 428 | /* discard ref obtained in find_memory_block() */ |
429 | kobject_put(&mem_blk->sysdev.kobj); | ||
430 | } | 429 | } |
430 | |||
431 | if (mem_blk) | ||
432 | kobject_put(&mem_blk->sysdev.kobj); | ||
431 | return err; | 433 | return err; |
432 | } | 434 | } |
433 | 435 | ||