From: Prarit Bhargava <prarit@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: Prarit Bhargava <prarit@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
=50@, x86@kernel.org, Len Brown <lenb@kernel.org>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
Linn Crosetto <linn@hp.com>, Pekka Enberg <penberg@kernel.org>,
Yinghai Lu <yinghai@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Toshi Kani <toshi.kani@hp.com>,
Tang Chen <tangchen@cn.fujitsu.com>,
Wen Congyang <wency@cn.fujitsu.com>,
Vivek Goyal <vgoyal@redhat.com>,
kosaki.motohiro@gmail.com, dyoung@redhat.com,
linux-acpi@vger.kernel.org, linux-mm@kvack.org
Subject: [PATCH 2/2] x86, e820 disable ACPI Memory Hotplug if memory mapping is specified by user
Date: Fri, 10 Jan 2014 13:46:19 -0500 [thread overview]
Message-ID: <1389379579-18614-3-git-send-email-prarit@redhat.com> (raw)
In-Reply-To: <1389379579-18614-1-git-send-email-prarit@redhat.com>
kdump uses memmap=exactmap and mem=X values to configure the memory
mapping for the kdump kernel. If memory is hotadded during the boot of
the kdump kernel it is possible that the page tables for the new memory
cause the kdump kernel to run out of memory.
Since the user has specified a specific mapping ACPI Memory Hotplug should be
disabled in this case.
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>=50%)
Cc: x86@kernel.org
Cc: Len Brown <lenb@kernel.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Linn Crosetto <linn@hp.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Toshi Kani <toshi.kani@hp.com>
Cc: Tang Chen <tangchen@cn.fujitsu.com>
Cc: Wen Congyang <wency@cn.fujitsu.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
Cc: kosaki.motohiro@gmail.com
Cc: dyoung@redhat.com
Cc: Toshi Kani <toshi.kani@hp.com>
Cc: linux-acpi@vger.kernel.org
Cc: linux-mm@kvack.org
---
arch/x86/kernel/e820.c | 8 +++++++-
drivers/acpi/acpi_memhotplug.c | 7 ++++++-
include/linux/memory_hotplug.h | 3 +++
3 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index 174da5f..dc1191f 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -20,6 +20,7 @@
#include <linux/firmware-map.h>
#include <linux/memblock.h>
#include <linux/sort.h>
+#include <linux/memory_hotplug.h>
#include <asm/e820.h>
#include <asm/proto.h>
@@ -880,15 +881,20 @@ static int __init parse_memmap_one(char *p)
return *p == '\0' ? 0 : -EINVAL;
}
+
static int __init parse_memmap_opt(char *str)
{
+ int ret;
+
while (str) {
char *k = strchr(str, ',');
if (k)
*k++ = 0;
- parse_memmap_one(str);
+ ret = parse_memmap_one(str);
+ if (!ret)
+ set_acpi_no_memhotplug();
str = k;
}
diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c
index 4a0fa94..48b9267 100644
--- a/drivers/acpi/acpi_memhotplug.c
+++ b/drivers/acpi/acpi_memhotplug.c
@@ -363,6 +363,11 @@ static void acpi_memory_device_remove(struct acpi_device *device)
static bool acpi_no_memhotplug;
+void set_acpi_no_memhotplug(void)
+{
+ acpi_no_memhotplug = true;
+}
+
void __init acpi_memory_hotplug_init(void)
{
if (acpi_no_memhotplug)
@@ -373,7 +378,7 @@ void __init acpi_memory_hotplug_init(void)
static int __init disable_acpi_memory_hotplug(char *str)
{
- acpi_no_memhotplug = true;
+ set_acpi_no_memhotplug();
return 1;
}
__setup("acpi_no_memhotplug", disable_acpi_memory_hotplug);
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h
index 4ca3d95..80f5a23 100644
--- a/include/linux/memory_hotplug.h
+++ b/include/linux/memory_hotplug.h
@@ -12,6 +12,9 @@ struct pglist_data;
struct mem_section;
struct memory_block;
+/* set flag to disable ACPI memory hotplug */
+extern void set_acpi_no_memhotplug(void);
+
#ifdef CONFIG_MEMORY_HOTPLUG
/*
--
1.7.9.3
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2014-01-10 18:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-10 18:46 [PATCH 0/2] Add option to disable ACPI Memory Hotplug Prarit Bhargava
2014-01-10 18:46 ` [PATCH 1/2] acpi memory hotplug, add parameter to disable memory hotplug Prarit Bhargava
2014-01-10 18:46 ` Prarit Bhargava [this message]
2014-01-10 19:00 ` [PATCH 2/2] x86, e820 disable ACPI Memory Hotplug if memory mapping is specified by user Prarit Bhargava
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=1389379579-18614-3-git-send-email-prarit@redhat.com \
--to=prarit@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=dyoung@redhat.com \
--cc=hpa@zytor.com \
--cc=kosaki.motohiro@gmail.com \
--cc=lenb@kernel.org \
--cc=linn@hp.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mingo@redhat.com \
--cc=penberg@kernel.org \
--cc=rjw@rjwysocki.net \
--cc=tangchen@cn.fujitsu.com \
--cc=tglx@linutronix.de \
--cc=toshi.kani@hp.com \
--cc=vgoyal@redhat.com \
--cc=wency@cn.fujitsu.com \
--cc=x86@kernel.org \
--cc=yinghai@kernel.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