From: tip-bot for Xunlei Pang <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: jpoimboe@redhat.com, torvalds@linux-foundation.org,
mingo@kernel.org, bp@alien8.de, yinghai@kernel.org,
dyoung@redhat.com, luto@kernel.org, linux-kernel@vger.kernel.org,
brgerst@gmail.com, ebiederm@xmission.com, xlpang@redhat.com,
peterz@infradead.org, tglx@linutronix.de, dvlasenk@redhat.com,
hpa@zytor.com
Subject: [tip:x86/urgent] x86/kexec/64: Use gbpages for identity mappings if available
Date: Mon, 8 May 2017 01:01:44 -0700 [thread overview]
Message-ID: <tip-8638100c52bb7782462b14aad102a4aaf0c7094c@git.kernel.org> (raw)
In-Reply-To: <1493862171-8799-2-git-send-email-xlpang@redhat.com>
Commit-ID: 8638100c52bb7782462b14aad102a4aaf0c7094c
Gitweb: http://git.kernel.org/tip/8638100c52bb7782462b14aad102a4aaf0c7094c
Author: Xunlei Pang <xlpang@redhat.com>
AuthorDate: Thu, 4 May 2017 09:42:51 +0800
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Mon, 8 May 2017 08:28:44 +0200
x86/kexec/64: Use gbpages for identity mappings if available
Kexec sets up all identity mappings before booting into the new
kernel, and this will cause extra memory consumption for paging
structures which is quite considerable on modern machines with
huge memory sizes.
E.g. on a 32TB machine that is kdumping, it could waste around
128MB (around 4MB/TB) from the reserved memory after kexec sets
all the identity mappings using the current 2MB page.
Add to that the memory needed for the loaded kdump kernel, initramfs,
etc., and it causes a kexec syscall -NOMEM failure.
As a result, we had to enlarge reserved memory via "crashkernel=X"
to work around this problem.
This causes some trouble for distributions that use policies
to evaluate the proper "crashkernel=X" value for users.
So enable gbpages for kexec mappings.
Signed-off-by: Xunlei Pang <xlpang@redhat.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Eric Biederman <ebiederm@xmission.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: akpm@linux-foundation.org
Cc: kexec@lists.infradead.org
Link: http://lkml.kernel.org/r/1493862171-8799-2-git-send-email-xlpang@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
arch/x86/kernel/machine_kexec_64.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c
index 1d4f2b0..c25d277 100644
--- a/arch/x86/kernel/machine_kexec_64.c
+++ b/arch/x86/kernel/machine_kexec_64.c
@@ -122,6 +122,10 @@ static int init_pgtable(struct kimage *image, unsigned long start_pgtable)
level4p = (pgd_t *)__va(start_pgtable);
clear_page(level4p);
+
+ if (direct_gbpages)
+ info.direct_gbpages = true;
+
for (i = 0; i < nr_pfn_mapped; i++) {
mstart = pfn_mapped[i].start << PAGE_SHIFT;
mend = pfn_mapped[i].end << PAGE_SHIFT;
next prev parent reply other threads:[~2017-05-08 8:08 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-04 1:42 [PATCH v3 1/2] x86/mm/ident_map: Add PUD level 1GB page support Xunlei Pang
2017-05-04 1:42 ` [PATCH v3 2/2] x86_64/kexec: Use PUD level 1GB page for identity mapping if available Xunlei Pang
2017-05-05 6:52 ` Ingo Molnar
2017-05-05 7:32 ` Xunlei Pang
2017-05-05 9:20 ` Ingo Molnar
2017-05-05 10:50 ` Xunlei Pang
2017-05-08 6:29 ` Ingo Molnar
2017-05-08 7:24 ` Xunlei Pang
2017-05-08 8:01 ` tip-bot for Xunlei Pang [this message]
2017-05-08 8:01 ` [tip:x86/urgent] x86/mm: Add support for gbpages to kernel_ident_mapping_init() tip-bot for Xunlei Pang
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=tip-8638100c52bb7782462b14aad102a4aaf0c7094c@git.kernel.org \
--to=tipbot@zytor.com \
--cc=bp@alien8.de \
--cc=brgerst@gmail.com \
--cc=dvlasenk@redhat.com \
--cc=dyoung@redhat.com \
--cc=ebiederm@xmission.com \
--cc=hpa@zytor.com \
--cc=jpoimboe@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=xlpang@redhat.com \
--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