public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: Ingo Molnar <mingo@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 3/3] x86/crash: Allocate enough low memory when crashkernel=high
Date: Mon,  8 Jun 2015 09:49:55 +0200	[thread overview]
Message-ID: <1433749795-5796-4-git-send-email-bp@alien8.de> (raw)
In-Reply-To: <1433749795-5796-1-git-send-email-bp@alien8.de>

From: Joerg Roedel <jroedel@suse.de>

When the crash kernel is loaded above 4GiB in memory, the
first kernel allocates only 72MiB of low-memory for the DMA
requirements of the second kernel. On systems with many
devices this is not enough and causes device driver
initialization errors and failed crash dumps. Testing by
SUSE and Redhat has shown that 256MiB is a good default
value for now and the discussion has lead to this value as
well. So set this default value to 256MiB to make sure there
is enough memory available for DMA.

Signed-off-by: Joerg Roedel <jroedel@suse.de>
Acked-by: Baoquan He <bhe@redhat.com>
Cc: Baoquan He <bhe@redhat.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jörg Rödel <joro@8bytes.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vivek Goyal <vgoyal@redhat.com>
Cc: kexec@lists.infradead.org
Cc: x86-ml <x86@kernel.org>
Link: http://lkml.kernel.org/r/1433500202-25531-4-git-send-email-joro@8bytes.org
[ Reflow comment. ]
Signed-off-by: Borislav Petkov <bp@suse.de>
---
 arch/x86/kernel/setup.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index d74ac33290ae..5a697e56634c 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -531,12 +531,15 @@ static void __init reserve_crashkernel_low(void)
 	if (ret != 0) {
 		/*
 		 * two parts from lib/swiotlb.c:
-		 *	swiotlb size: user specified with swiotlb= or default.
-		 *	swiotlb overflow buffer: now is hardcoded to 32k.
-		 *		We round it to 8M for other buffers that
-		 *		may need to stay low too.
+		 * - swiotlb size: user-specified with swiotlb= or default.
+		 *
+		 * -swiotlb overflow buffer: now hardcoded to 32k.
+		 *
+		 * We round it to 8M for other buffers that may need to stay low
+		 * too. Also make sure we allocate enough extra low memory so
+		 * that we don't run out of DMA buffers for 32-bit devices.
 		 */
-		low_size = swiotlb_size_or_default() + (8UL<<20);
+		low_size = max(swiotlb_size_or_default() + (8UL<<20), 256UL<<20);
 		auto_set = true;
 	} else {
 		/* passed with crashkernel=0,low ? */
-- 
2.3.5


  parent reply	other threads:[~2015-06-08  7:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-08  7:49 [PATCH 0/3] tip queue 2015-06-08 Borislav Petkov
2015-06-08  7:49 ` [PATCH 1/3] swiotlb: Warn on allocation failure in swiotlb_alloc_coherent() Borislav Petkov
2015-06-08  7:49 ` [PATCH 2/3] x86/swiotlb: Try coherent allocations with __GFP_NOWARN Borislav Petkov
2015-06-08  7:49 ` Borislav Petkov [this message]
2015-06-09  0:20   ` [PATCH 3/3] x86/crash: Allocate enough low memory when crashkernel=high Yinghai Lu
2015-06-10  7:04     ` Baoquan He
2015-06-10 17:48       ` Yinghai Lu
2015-06-11  0:36         ` Baoquan He
2015-06-11  6:44         ` Joerg Roedel

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=1433749795-5796-4-git-send-email-bp@alien8.de \
    --to=bp@alien8.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@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