All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm/sparse: reset section's mem_map when fully deactivated
@ 2020-01-16  3:01 Pingfan Liu
  2020-01-16  3:18 ` Qian Cai
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Pingfan Liu @ 2020-01-16  3:01 UTC (permalink / raw)
  To: linux-mm
  Cc: Pingfan Liu, Andrew Morton, David Hildenbrand, Dan Williams,
	Oscar Salvador, Michal Hocko, kexec, Kazuhito Hagio

When fully deactivated, it is meaningless to keep the value of a section's
mem_map. And its mem_map will be reassigned during re-added.

Beside this, it breaks the user space tool "makedumpfile", which makes
assumption that a hot-removed section having mem_map as NULL.

The bug can be reproduced on IBM POWERVM by "drmgr -c mem -r -q 5" ,
trigger a crash, and save vmcore by makedumpfile

Signed-off-by: Pingfan Liu <kernelfans@gmail.com>
To: linux-mm@kvack.org
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: David Hildenbrand <david@redhat.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: kexec@lists.infradead.org
Cc: Kazuhito Hagio <k-hagio@ab.jp.nec.com>
---
 mm/sparse.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/sparse.c b/mm/sparse.c
index 3822ecb..fddac80 100644
--- a/mm/sparse.c
+++ b/mm/sparse.c
@@ -789,7 +789,7 @@ static void section_deactivate(unsigned long pfn, unsigned long nr_pages,
 			ms->usage = NULL;
 		}
 		memmap = sparse_decode_mem_map(ms->section_mem_map, section_nr);
-		ms->section_mem_map = sparse_encode_mem_map(NULL, section_nr);
+		ms->section_mem_map = NULL;
 	}
 
 	if (section_is_early && memmap)
-- 
2.7.5



^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2020-01-20  2:31 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-16  3:01 [PATCH] mm/sparse: reset section's mem_map when fully deactivated Pingfan Liu
2020-01-16  3:18 ` Qian Cai
2020-01-16  3:34   ` Pingfan Liu
2020-01-16  7:50 ` Michal Hocko
2020-01-17  6:22   ` Pingfan Liu
2020-01-17  7:14     ` Dan Williams
2020-01-17  7:47       ` Michal Hocko
2020-01-17  9:49         ` Pingfan Liu
2020-01-17  9:52           ` David Hildenbrand
2020-01-20  2:31             ` Pingfan Liu
2020-01-16  8:06 ` David Hildenbrand
2020-01-16  8:14   ` David Hildenbrand
2020-01-16  8:24     ` Baoquan He
2020-01-16  8:57       ` David Hildenbrand
2020-01-17  6:20       ` Pingfan Liu
2020-01-17  6:18   ` Pingfan Liu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.