From: Hari Bathini <hbathini@linux.vnet.ibm.com>
To: linuxppc-dev <linuxppc-dev@ozlabs.org>
Subject: [PATCH 1/3] powerpc/fadump: set an upper limit for the default memory reserved for fadump
Date: Fri, 06 May 2016 17:20:07 +0530 [thread overview]
Message-ID: <20160506115007.26330.89135.stgit@hbathini.in.ibm.com> (raw)
When boot memory size for fadump is not specified, memory is reserved
for fadump based on system RAM size. As the system RAM size increases,
the memory reserved for fadump increases as well. This patch sets an
upper limit on the memory reserved for fadump, to avoid reserving
excess memory.
Signed-off-by: Hari Bathini <hbathini@linux.vnet.ibm.com>
---
arch/powerpc/include/asm/fadump.h | 6 ++++++
arch/powerpc/kernel/fadump.c | 4 ++++
2 files changed, 10 insertions(+)
diff --git a/arch/powerpc/include/asm/fadump.h b/arch/powerpc/include/asm/fadump.h
index b4407d0..2c3cb32 100644
--- a/arch/powerpc/include/asm/fadump.h
+++ b/arch/powerpc/include/asm/fadump.h
@@ -43,6 +43,12 @@
#define MIN_BOOT_MEM (((RMA_END < (0x1UL << 28)) ? (0x1UL << 28) : RMA_END) \
+ (0x1UL << 26))
+/*
+ * Maximum memory needed for fadump to boot up successfully. Use this as
+ * an upper limit for fadump so we don't endup reserving excess memory.
+ */
+#define MAX_BOOT_MEM (0x1UL << 32)
+
#define memblock_num_regions(memblock_type) (memblock.memblock_type.cnt)
#ifndef ELF_CORE_EFLAGS
diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c
index 3cb3b02a..d0af58b 100644
--- a/arch/powerpc/kernel/fadump.c
+++ b/arch/powerpc/kernel/fadump.c
@@ -225,6 +225,10 @@ static inline unsigned long fadump_calculate_reserve_size(void)
/* round it down in multiples of 256 */
size = size & ~0x0FFFFFFFUL;
+ /* Set an upper limit on the memory to be reserved */
+ if (size > MAX_BOOT_MEM)
+ size = MAX_BOOT_MEM;
+
/* Truncate to memory_limit. We don't want to over reserve the memory.*/
if (memory_limit && size > memory_limit)
size = memory_limit;
next reply other threads:[~2016-05-06 11:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-06 11:50 Hari Bathini [this message]
2016-05-06 11:50 ` [PATCH 2/3] powerpc/fadump: add support to specify memory range based size Hari Bathini
2016-05-07 4:11 ` [2/3] " Michael Ellerman
2016-05-09 9:37 ` Hari Bathini
2016-05-06 11:51 ` [PATCH 3/3] powerpc/fadump: add support for fadump_nr_cpus= parameter Hari Bathini
2016-05-07 4:12 ` [3/3] " Michael Ellerman
2016-05-09 9:35 ` Hari Bathini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160506115007.26330.89135.stgit@hbathini.in.ibm.com \
--to=hbathini@linux.vnet.ibm.com \
--cc=linuxppc-dev@ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).