Skip to contentSkip to conversation

mm: sections are not offlined during memory hotremove

PATCH New [email protected] 1 participant 1 message May 11, 2018

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 6/13 mm: sections are not offlined during memory hotremove

From: Pavel Tatashin <[email protected]>
Subject: mm: sections are not offlined during memory hotremove

Memory hotplug and hotremove operate with per-block granularity. If the machine has a large amount of memory (more than 64G), the size of a memory block can span multiple sections. By mistake, during hotremove we set only the first section to offline state.

The bug was discovered because kernel selftest started to fail:
https://lkml.kernel.org/r/20180423011247.GK5563@yexl-desktop

After commit, "mm/memory_hotplug: optimize probe routine". But, the bug is older than this commit. In this optimization we also added a check for sections to be in a proper state during hotplug operation.

Fixes 2d070eab2e82 ("mm: consider zone which is not fully populated to have holes")
Cc Vlastimil Babka <[email protected]>
Cc Steven Sistare <[email protected]>
Cc Daniel Jordan <[email protected]>
Cc "Kirill A. Shutemov" <[email protected]>

---

 mm/sparse.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/sparse.c renamed from mm/sparse.c~mm-sections-are-not-offlined-during-memory-hotremove +1 -1
diff -puN mm/sparse.c~mm-sections-are-not-offlined-during-memory-hotremove mm/sparse.c
@@ -629,7 +629,7 @@ void offline_mem_sections(unsigned long
 	unsigned long pfn;
 
 	for (pfn = start_pfn; pfn < end_pfn; pfn += PAGES_PER_SECTION) {
-		unsigned long section_nr = pfn_to_section_nr(start_pfn);
+		unsigned long section_nr = pfn_to_section_nr(pfn);
 		struct mem_section *ms;
 
 		/*

_