linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc/powernv: Increase memory block size to 1GB on radix
@ 2017-09-07  5:05 Anton Blanchard
  2017-09-07  5:09 ` Aneesh Kumar K.V
  2017-10-06 11:10 ` Michael Ellerman
  0 siblings, 2 replies; 9+ messages in thread
From: Anton Blanchard @ 2017-09-07  5:05 UTC (permalink / raw)
  To: benh, paulus, mpe, bharata, arbab, npiggin, mikey, cyrilbur,
	aneesh.kumar
  Cc: linuxppc-dev

From: Anton Blanchard <anton@samba.org>

Memory hot unplug on PowerNV radix hosts is broken. Our memory block
size is 256MB but since we map the linear region with very large pages,
each pte we tear down maps 1GB.

A hot unplug of one 256MB memory block results in 768MB of memory
getting unintentionally unmapped. At this point we are likely to oops.

Fix this by increasing our memory block size to 1GB on PowerNV radix
hosts.

Signed-off-by: Anton Blanchard <anton@samba.org>
---
 arch/powerpc/platforms/powernv/setup.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/powernv/setup.c b/arch/powerpc/platforms/powernv/setup.c
index 897aa1400eb8..bbb73aa0eb8f 100644
--- a/arch/powerpc/platforms/powernv/setup.c
+++ b/arch/powerpc/platforms/powernv/setup.c
@@ -272,7 +272,15 @@ static void pnv_kexec_cpu_down(int crash_shutdown, int secondary)
 #ifdef CONFIG_MEMORY_HOTPLUG_SPARSE
 static unsigned long pnv_memory_block_size(void)
 {
-	return 256UL * 1024 * 1024;
+	/*
+	 * We map the kernel linear region with 1GB large pages on radix. For
+	 * memory hot unplug to work our memory block size must be at least
+	 * this size.
+	 */
+	if (radix_enabled())
+		return 1UL * 1024 * 1024 * 1024;
+	else
+		return 256UL * 1024 * 1024;
 }
 #endif
 
-- 
2.11.0

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

end of thread, other threads:[~2017-10-06 11:10 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-07  5:05 [PATCH] powerpc/powernv: Increase memory block size to 1GB on radix Anton Blanchard
2017-09-07  5:09 ` Aneesh Kumar K.V
2017-09-07  5:17   ` Anton Blanchard
2017-09-07  7:21     ` Benjamin Herrenschmidt
2017-09-08 21:51       ` Balbir Singh
2017-09-07 15:59     ` Reza Arbab
2017-09-08  1:15       ` Anton Blanchard
2017-09-09 21:30         ` Michael Ellerman
2017-10-06 11:10 ` Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).