linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Hari Bathini <hbathini@linux.vnet.ibm.com>
To: linuxppc-dev <linuxppc-dev@ozlabs.org>
Subject: [PATCH 3/3] powerpc/fadump: add support for fadump_nr_cpus= parameter
Date: Fri, 06 May 2016 17:21:08 +0530	[thread overview]
Message-ID: <20160506115108.26330.38061.stgit@hbathini.in.ibm.com> (raw)
In-Reply-To: <20160506115007.26330.89135.stgit@hbathini.in.ibm.com>

Kernel parameter 'nr_cpus' can be used to limit the maximum number
of processors that an SMP kernel could support. This patch extends
this to fadump by introducing 'fadump_nr_cpus' parameter that can
help in booting fadump kernel on a lower memory footprint.

Suggested-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Signed-off-by: Hari Bathini <hbathini@linux.vnet.ibm.com>
---
 arch/powerpc/kernel/fadump.c |   22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c
index a7fef3e..c75783c 100644
--- a/arch/powerpc/kernel/fadump.c
+++ b/arch/powerpc/kernel/fadump.c
@@ -470,6 +470,28 @@ static int __init early_fadump_param(char *p)
 }
 early_param("fadump", early_fadump_param);
 
+/* Look for fadump_nr_cpus= cmdline option. */
+static int __init early_fadump_nrcpus(char *p)
+{
+	int nr_cpus;
+
+	/*
+	 * fadump_nr_cpus parameter is only applicable on a
+	 * fadump active kernel. This is to reduce memory
+	 * needed to boot a fadump active kernel.
+	 * So, check if we are booting after crash.
+	 */
+	if (!is_fadump_active())
+		return 0;
+
+	get_option(&p, &nr_cpus);
+	if (nr_cpus > 0 && nr_cpus < nr_cpu_ids)
+		nr_cpu_ids = nr_cpus;
+
+	return 0;
+}
+early_param("fadump_nr_cpus", early_fadump_nrcpus);
+
 static void register_fw_dump(struct fadump_mem_struct *fdm)
 {
 	int rc;

  parent reply	other threads:[~2016-05-06 11:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-06 11:50 [PATCH 1/3] powerpc/fadump: set an upper limit for the default memory reserved for fadump Hari Bathini
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 ` Hari Bathini [this message]
2016-05-07  4:12   ` [3/3] powerpc/fadump: add support for fadump_nr_cpus= parameter 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=20160506115108.26330.38061.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).