Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+4 -27
+4 -27
drivers/base/node.c
··· 390 390 sect_end_pfn = section_nr_to_pfn(mem_blk->end_section_nr); 391 391 sect_end_pfn += PAGES_PER_SECTION - 1; 392 392 for (pfn = sect_start_pfn; pfn <= sect_end_pfn; pfn++) { 393 - int page_nid, scn_nr; 394 - 395 - /* 396 - * memory block could have several absent sections from start. 397 - * skip pfn range from absent section 398 - */ 399 - scn_nr = pfn_to_section_nr(pfn); 400 - if (!present_section_nr(scn_nr)) { 401 - pfn = round_down(pfn + PAGES_PER_SECTION, 402 - PAGES_PER_SECTION) - 1; 403 - continue; 404 - } 393 + int page_nid; 405 394 406 395 /* 407 396 * memory block could have several absent sections from start. ··· 436 447 return -ENOMEM; 437 448 nodes_clear(*unlinked_nodes); 438 449 439 - sect_start_pfn = section_nr_to_pfn(mem_blk->start_section_nr); 440 - sect_end_pfn = section_nr_to_pfn(mem_blk->end_section_nr); 441 - sect_end_pfn += PAGES_PER_SECTION - 1; 450 + sect_start_pfn = section_nr_to_pfn(phys_index); 451 + sect_end_pfn = sect_start_pfn + PAGES_PER_SECTION - 1; 442 452 for (pfn = sect_start_pfn; pfn <= sect_end_pfn; pfn++) { 443 - int nid, scn_nr; 444 - 445 - /* 446 - * memory block could have several absent sections from start. 447 - * skip pfn range from absent section 448 - */ 449 - scn_nr = pfn_to_section_nr(pfn); 450 - if (!present_section_nr(scn_nr)) { 451 - pfn = round_down(pfn + PAGES_PER_SECTION, 452 - PAGES_PER_SECTION) - 1; 453 - continue; 454 - } 453 + int nid; 455 454 456 455 nid = get_nid_for_pfn(pfn); 457 456 if (nid < 0)