[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1389380698-19361-4-git-send-email-prarit@redhat.com>
Date: Fri, 10 Jan 2014 14:04:58 -0500
From: Prarit Bhargava <prarit@...hat.com>
To: linux-kernel@...r.kernel.org
Cc: Prarit Bhargava <prarit@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>, x86@...nel.org,
Len Brown <lenb@...nel.org>,
"Rafael J. Wysocki" <rjw@...ysocki.net>,
Linn Crosetto <linn@...com>, Pekka Enberg <penberg@...nel.org>,
Yinghai Lu <yinghai@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Toshi Kani <toshi.kani@...com>,
Tang Chen <tangchen@...fujitsu.com>,
Wen Congyang <wency@...fujitsu.com>,
Vivek Goyal <vgoyal@...hat.com>, kosaki.motohiro@...il.com,
dyoung@...hat.com, linux-acpi@...r.kernel.org, linux-mm@...ck.org
Subject: [PATCH 2/2] x86, e820 disable ACPI Memory Hotplug if memory mapping is specified by user [v2]
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.
[v2]: really add mem=
Signed-off-by: Prarit Bhargava <prarit@...hat.com>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Ingo Molnar <mingo@...hat.com>
Cc: "H. Peter Anvin" <hpa@...or.com>
Cc: x86@...nel.org
Cc: Len Brown <lenb@...nel.org>
Cc: "Rafael J. Wysocki" <rjw@...ysocki.net>
Cc: Linn Crosetto <linn@...com>
Cc: Pekka Enberg <penberg@...nel.org>
Cc: Yinghai Lu <yinghai@...nel.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: Toshi Kani <toshi.kani@...com>
Cc: Tang Chen <tangchen@...fujitsu.com>
Cc: Wen Congyang <wency@...fujitsu.com>
Cc: Vivek Goyal <vgoyal@...hat.com>
Cc: kosaki.motohiro@...il.com
Cc: dyoung@...hat.com
Cc: Toshi Kani <toshi.kani@...com>
Cc: linux-acpi@...r.kernel.org
Cc: linux-mm@...ck.org
---
arch/x86/kernel/e820.c | 10 +++++++++-
drivers/acpi/acpi_memhotplug.c | 7 ++++++-
include/linux/memory_hotplug.h | 3 +++
3 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index 174da5f..747f36a 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>
@@ -834,6 +835,8 @@ static int __init parse_memopt(char *p)
return -EINVAL;
e820_remove_range(mem_size, ULLONG_MAX - mem_size, E820_RAM, 1);
+ set_acpi_no_memhotplug();
+
return 0;
}
early_param("mem", parse_memopt);
@@ -880,15 +883,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 from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists