summaryrefslogtreecommitdiff
path: root/drivers/base
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-10-13 10:57:25 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-10-13 10:57:25 -0700
commit8346aa765e14348b7b436825b3c4740895a2fe1a (patch)
treedb2644417bc07d6b39a20dac27e98622f43c5d46 /drivers/base
parentdbe2256ddd8e8420c254c79f4045c41cb5f4bd6b (diff)
Revert "mm: Check if section present during memory block (un)registering"
This reverts commit 7568fb63f57ac8672f8bf2018171255441238882 as it's already in Linus's tree through a different patch. Reported-by: Tony Luck <tony.luck@intel.com> Cc: Yinghai Lu <yinghai@kernel.org> Cc: stable@vger.kernel.org #v3.15 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/node.c31
1 files changed, 4 insertions, 27 deletions
diff --git a/drivers/base/node.c b/drivers/base/node.c
index ae98ebaf6313..560751bad294 100644
--- a/drivers/base/node.c
+++ b/drivers/base/node.c
@@ -390,18 +390,7 @@ int register_mem_sect_under_node(struct memory_block *mem_blk, int nid)
sect_end_pfn = section_nr_to_pfn(mem_blk->end_section_nr);
sect_end_pfn += PAGES_PER_SECTION - 1;
for (pfn = sect_start_pfn; pfn <= sect_end_pfn; pfn++) {
- int page_nid, scn_nr;
-
- /*
- * memory block could have several absent sections from start.
- * skip pfn range from absent section
- */
- scn_nr = pfn_to_section_nr(pfn);
- if (!present_section_nr(scn_nr)) {
- pfn = round_down(pfn + PAGES_PER_SECTION,
- PAGES_PER_SECTION) - 1;
- continue;
- }
+ int page_nid;
/*
* memory block could have several absent sections from start.
@@ -447,22 +436,10 @@ int unregister_mem_sect_under_nodes(struct memory_block *mem_blk,
return -ENOMEM;
nodes_clear(*unlinked_nodes);
- sect_start_pfn = section_nr_to_pfn(mem_blk->start_section_nr);
- sect_end_pfn = section_nr_to_pfn(mem_blk->end_section_nr);
- sect_end_pfn += PAGES_PER_SECTION - 1;
+ sect_start_pfn = section_nr_to_pfn(phys_index);
+ sect_end_pfn = sect_start_pfn + PAGES_PER_SECTION - 1;
for (pfn = sect_start_pfn; pfn <= sect_end_pfn; pfn++) {
- int nid, scn_nr;
-
- /*
- * memory block could have several absent sections from start.
- * skip pfn range from absent section
- */
- scn_nr = pfn_to_section_nr(pfn);
- if (!present_section_nr(scn_nr)) {
- pfn = round_down(pfn + PAGES_PER_SECTION,
- PAGES_PER_SECTION) - 1;
- continue;
- }
+ int nid;
nid = get_nid_for_pfn(pfn);
if (nid < 0)