diff options
author | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2015-04-16 08:47:33 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2015-04-23 10:52:01 -0400 |
commit | 7e01b5acd88b3f3108d8c4ce44e3205d67437202 (patch) | |
tree | 8278dc40fdf14dedb0b89435a659de3fd413faec | |
parent | 27cf3a16b2535a490f8cf1d29a6634f1c70f7831 (diff) |
kexec: allocate the kexec control page with KEXEC_CONTROL_MEMORY_GFP
Introduce KEXEC_CONTROL_MEMORY_GFP to allow the architecture code
to override the gfp flags of the allocation for the kexec control
page. The loop in kimage_alloc_normal_control_pages allocates pages
with GFP_KERNEL until a page is found that happens to have an
address smaller than the KEXEC_CONTROL_MEMORY_LIMIT. On systems
with a large memory size but a small KEXEC_CONTROL_MEMORY_LIMIT
the loop will keep allocating memory until the oom killer steps in.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
-rw-r--r-- | arch/s390/include/asm/kexec.h | 3 | ||||
-rw-r--r-- | include/linux/kexec.h | 4 | ||||
-rw-r--r-- | kernel/kexec.c | 2 |
3 files changed, 8 insertions, 1 deletions
diff --git a/arch/s390/include/asm/kexec.h b/arch/s390/include/asm/kexec.h index 694bcd6bd927..2f924bc30e35 100644 --- a/arch/s390/include/asm/kexec.h +++ b/arch/s390/include/asm/kexec.h | |||
@@ -26,6 +26,9 @@ | |||
26 | /* Not more than 2GB */ | 26 | /* Not more than 2GB */ |
27 | #define KEXEC_CONTROL_MEMORY_LIMIT (1UL<<31) | 27 | #define KEXEC_CONTROL_MEMORY_LIMIT (1UL<<31) |
28 | 28 | ||
29 | /* Allocate control page with GFP_DMA */ | ||
30 | #define KEXEC_CONTROL_MEMORY_GFP GFP_DMA | ||
31 | |||
29 | /* Maximum address we can use for the crash control pages */ | 32 | /* Maximum address we can use for the crash control pages */ |
30 | #define KEXEC_CRASH_CONTROL_MEMORY_LIMIT (-1UL) | 33 | #define KEXEC_CRASH_CONTROL_MEMORY_LIMIT (-1UL) |
31 | 34 | ||
diff --git a/include/linux/kexec.h b/include/linux/kexec.h index e60a745ac198..e804306ef5e8 100644 --- a/include/linux/kexec.h +++ b/include/linux/kexec.h | |||
@@ -40,6 +40,10 @@ | |||
40 | #error KEXEC_CONTROL_MEMORY_LIMIT not defined | 40 | #error KEXEC_CONTROL_MEMORY_LIMIT not defined |
41 | #endif | 41 | #endif |
42 | 42 | ||
43 | #ifndef KEXEC_CONTROL_MEMORY_GFP | ||
44 | #define KEXEC_CONTROL_MEMORY_GFP GFP_KERNEL | ||
45 | #endif | ||
46 | |||
43 | #ifndef KEXEC_CONTROL_PAGE_SIZE | 47 | #ifndef KEXEC_CONTROL_PAGE_SIZE |
44 | #error KEXEC_CONTROL_PAGE_SIZE not defined | 48 | #error KEXEC_CONTROL_PAGE_SIZE not defined |
45 | #endif | 49 | #endif |
diff --git a/kernel/kexec.c b/kernel/kexec.c index 38c25b1f2fd5..7a36fdcca5bf 100644 --- a/kernel/kexec.c +++ b/kernel/kexec.c | |||
@@ -707,7 +707,7 @@ static struct page *kimage_alloc_normal_control_pages(struct kimage *image, | |||
707 | do { | 707 | do { |
708 | unsigned long pfn, epfn, addr, eaddr; | 708 | unsigned long pfn, epfn, addr, eaddr; |
709 | 709 | ||
710 | pages = kimage_alloc_pages(GFP_KERNEL, order); | 710 | pages = kimage_alloc_pages(KEXEC_CONTROL_MEMORY_GFP, order); |
711 | if (!pages) | 711 | if (!pages) |
712 | break; | 712 | break; |
713 | pfn = page_to_pfn(pages); | 713 | pfn = page_to_pfn(pages); |