lkml.org 
[lkml]   [2015]   [Aug]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subject[PATCH] kexec: override GFP flag for the control page allocation
Date
Greetings,

I got a bug report that kexec does not work on s390 if the system has
lots of memory. It is the kexec load step that dies with out-of-memory.

The reason why this happens is the value of KEXEC_CONTROL_MEMORY_LIMIT
for s390. To start the new kernel the code in the kexec control page
needs to switch to the ESA mode (31-bit), therefore the memory limit
is 2GB for s390. The allocation of the control page is done with
GFP_KERNEL in kimage_alloc_normal_control_pages. If the allocated page
is a target page in the kexec destination range or if its address is
larger than the memory limit, it is put on the list of extra pages
and another page is allocated until one is found that fits the
requirements.

With a large memory size not only does this loop take a long time to
complete (think 10 terabyte of memory), but eventually the OOM killer
steps in and terminates the program that called kexec load.

The fix for s390 is to use a different GFP flag, GFP_DMA instead of
GFP_KERNEL. To do this a new #define for kexec is introduced that
can be overruled by the architecture.

Martin Schwidefsky (1):
kexec: allocate the kexec control page with KEXEC_CONTROL_MEMORY_GFP

arch/s390/include/asm/kexec.h | 3 +++
include/linux/kexec.h | 4 ++++
kernel/kexec.c | 2 +-
3 files changed, 8 insertions(+), 1 deletion(-)

--
1.9.1



\
 
 \ /
  Last update: 2015-08-09 21:21    [W:0.708 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site