From: Yinghai Lu <yinghai@kernel.org>
To: Vivek Goyal <vgoyal@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@elte.hu>,
"H. Peter Anvin" <hpa@zytor.com>, WANG Chao <chaowang@redhat.com>,
"Eric W. Biederman" <ebiederm@xmission.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86, kdump: Set crashkernel_low automatically
Date: Mon, 11 Mar 2013 11:44:16 -0700 [thread overview]
Message-ID: <CAE9FiQUu-AwKhsAdUautjxduW5a-pxpv8XFY-p1LWSmb-itATg@mail.gmail.com> (raw)
In-Reply-To: <20130311182655.GB12107@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1464 bytes --]
On Mon, Mar 11, 2013 at 11:26 AM, Vivek Goyal <vgoyal@redhat.com> wrote:
> On Mon, Mar 11, 2013 at 10:58:39AM -0700, Yinghai Lu wrote:
>> On Mon, Mar 11, 2013 at 8:02 AM, Vivek Goyal <vgoyal@redhat.com> wrote:
>> >
>> > IOW, wouldn't it be better that crashkernel=X first tries to find
>> > requested amount of memory in lowest memory area available/possible.
>>
>> Yest, that is much better, and user even could stay with old kexec-tools
>> for system that does not tons of memory.
>> And I don't need to mess up with auto setting crashkernel_low or export
>> swiotlb_size() etc.
>>
>> Please check if you are ok with attached one.
>>
> Hi Yinghai,
>
> In mutt your patches are showing as attachment instead of inline. Mutt
> thinks attachment is of type "application/octet-stream". Not sure if
> this is configuration issue on my part or something is going on your
> end.
I sent it via gmail and it only can have attachment instead of inline.
>
> I have few more concerns.
>
> - Are we able to reserve 512MB memory now below 896MB. I remember so
> far it was broken.
It also depends BIOS memmap layout. some bios put reserved on middle of ram
like just below 512M or just 2G.
>
> - If reserving memory below 896MB fails, we immediately switch to
> reserving anywhere till MAXMEM. Would it make sense to first try
> to reserve it below 4G (so that we don't have to worry much about
> swiotlb or iommu being on).
ok.
Attached again.
Thanks
Yinghai
[-- Attachment #2: fix_crashkernel_low_v2.patch --]
[-- Type: application/octet-stream, Size: 3329 bytes --]
Subject: [PATCH] x86, kdump, 64bit: Try allocate crashkernel under 896M at first
On 64bit system, we try allocate crashkernel above 4G at first,
and does not set low range for crashkernel if the user does not
specify that.
That cause regressions on system that does not support intel_iommu
properly.
Chao said that his system does work well on 3.8 without extra parameter.
even iommu does not work with kdump.
Change to try use old 896M limit at first and then try to allocate above 4G.
Also update kernel parameters to make it clear when that is needed.
-v2: try 4G below and at last try MAXMEM according to Vivek.
Reported-by: WANG Chao <chaowang@redhat.com>
Suggested-by: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
---
Documentation/kernel-parameters.txt | 10 +++++++---
arch/x86/kernel/setup.c | 15 ++++++++++++++-
2 files changed, 21 insertions(+), 4 deletions(-)
Index: linux-2.6/Documentation/kernel-parameters.txt
===================================================================
--- linux-2.6.orig/Documentation/kernel-parameters.txt
+++ linux-2.6/Documentation/kernel-parameters.txt
@@ -596,9 +596,6 @@ bytes respectively. Such letter suffixes
is selected automatically. Check
Documentation/kdump/kdump.txt for further details.
- crashkernel_low=size[KMG]
- [KNL, x86] parts under 4G.
-
crashkernel=range1:size1[,range2:size2,...][@offset]
[KNL] Same as above, but depends on the memory
in the running system. The syntax of range is
@@ -606,6 +603,13 @@ bytes respectively. Such letter suffixes
a memory unit (amount[KMG]). See also
Documentation/kdump/kdump.txt for an example.
+ crashkernel_low=size[KMG]
+ [KNL, x86_64] range under 4G. When crashkernel= request
+ more than 512M, kernel allocate physical memory region
+ above 4G, that cause second kernel crash on system that
+ need swiotlb later. This one let user to specify extra
+ low range under 4G for second kernel.
+
cs89x0_dma= [HW,NET]
Format: <dma>
Index: linux-2.6/arch/x86/kernel/setup.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/setup.c
+++ linux-2.6/arch/x86/kernel/setup.c
@@ -507,11 +507,12 @@ static void __init memblock_x86_reserve_
/*
* Keep the crash kernel below this limit. On 32 bits earlier kernels
* would limit the kernel to the low 512 MiB due to mapping restrictions.
+ * On 64 bits, kexec-tools (before 2.0.4) limits us to 896 MiB.
*/
#ifdef CONFIG_X86_32
# define CRASH_KERNEL_ADDR_MAX (512 << 20)
#else
-# define CRASH_KERNEL_ADDR_MAX MAXMEM
+# define CRASH_KERNEL_ADDR_MAX (896 << 20)
#endif
static void __init reserve_crashkernel_low(void)
@@ -571,6 +572,18 @@ static void __init reserve_crashkernel(v
crash_base = memblock_find_in_range(alignment,
CRASH_KERNEL_ADDR_MAX, crash_size, alignment);
+#ifdef CONFIG_X86_64
+ /* try under 4G at first */
+ if (!crash_base)
+ crash_base = memblock_find_in_range(alignment,
+ 1UL<<32, crash_size, alignment);
+ /* above 4G now */
+ if (!crash_base)
+ crash_base = memblock_find_in_range(alignment,
+ MAXMEM, crash_size, alignment);
+
+#endif
+
if (!crash_base) {
pr_info("crashkernel reservation failed - No suitable area found.\n");
return;
next prev parent reply other threads:[~2013-03-11 18:44 UTC|newest]
Thread overview: 101+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-08 5:54 3.9-rc1: crash kernel panic - not syncing: Can not allocate SWIOTLB buffer earlier and can't now provide you with the DMA bounce buffer WANG Chao
2013-03-08 6:03 ` CAI Qian
2013-03-08 6:32 ` Yinghai Lu
2013-03-08 6:36 ` Yinghai Lu
2013-03-08 7:20 ` WANG Chao
2013-03-08 7:27 ` Yinghai Lu
2013-03-08 7:33 ` WANG Chao
2013-03-08 7:50 ` Yinghai Lu
2013-03-08 12:12 ` WANG Chao
2013-03-08 18:24 ` Yinghai Lu
2013-03-08 19:39 ` Yinghai Lu
2013-03-11 3:42 ` WANG Chao
2013-03-11 4:56 ` [PATCH] x86, kdump: Set crashkernel_low automatically Yinghai Lu
2013-03-11 14:48 ` Vivek Goyal
2013-03-11 15:02 ` Vivek Goyal
2013-03-11 17:58 ` Yinghai Lu
2013-03-11 18:26 ` Vivek Goyal
2013-03-11 18:44 ` Yinghai Lu [this message]
2013-03-11 18:46 ` H. Peter Anvin
2013-03-11 18:50 ` Yinghai Lu
2013-03-11 18:55 ` H. Peter Anvin
2013-03-11 19:06 ` Yinghai Lu
2013-03-11 19:06 ` H. Peter Anvin
2013-03-11 19:08 ` Yinghai Lu
2013-03-11 19:20 ` Vivek Goyal
2013-03-11 19:55 ` H. Peter Anvin
2013-03-11 20:12 ` Vivek Goyal
2013-03-11 20:19 ` H. Peter Anvin
2013-03-11 20:36 ` H. Peter Anvin
2013-03-11 20:38 ` Eric W. Biederman
2013-03-11 20:42 ` H. Peter Anvin
2013-03-11 21:10 ` Vivek Goyal
2013-03-11 21:13 ` H. Peter Anvin
2013-03-11 20:45 ` Vivek Goyal
2013-03-11 20:50 ` H. Peter Anvin
2013-03-11 21:03 ` Vivek Goyal
2013-03-11 21:06 ` H. Peter Anvin
2013-03-12 13:46 ` Vivek Goyal
2013-03-12 8:35 ` Ingo Molnar
2013-03-11 20:57 ` Yinghai Lu
2013-03-11 21:06 ` Vivek Goyal
2013-03-11 21:15 ` Yinghai Lu
2013-03-11 19:10 ` Vivek Goyal
2013-03-11 19:34 ` Yinghai Lu
2013-03-11 19:38 ` Vivek Goyal
2013-03-11 19:39 ` Yinghai Lu
2013-03-11 19:44 ` Vivek Goyal
2013-03-11 19:44 ` Yinghai Lu
2013-03-18 14:46 ` Vivek Goyal
2013-03-18 15:33 ` Vivek Goyal
2013-03-18 19:05 ` Yinghai Lu
2013-03-18 19:10 ` H. Peter Anvin
2013-03-18 20:00 ` Vivek Goyal
2013-03-18 21:14 ` H. Peter Anvin
2013-03-18 21:25 ` [PATCH v3] " Yinghai Lu
2013-03-18 22:52 ` H. Peter Anvin
2013-03-18 23:26 ` Yinghai Lu
2013-03-19 0:27 ` H. Peter Anvin
2013-03-19 1:04 ` [PATCH v4] " Yinghai Lu
2013-03-19 13:33 ` Vivek Goyal
2013-03-19 15:05 ` [PATCH v5] " Yinghai Lu
2013-03-20 13:08 ` Vivek Goyal
2013-03-20 15:53 ` Yinghai Lu
2013-03-20 16:03 ` Vivek Goyal
2013-03-20 16:21 ` Yinghai Lu
2013-03-20 16:31 ` Vivek Goyal
2013-03-20 19:22 ` [PATCH] kexec: use Crash kernel for Crash kernel low Yinghai Lu
2013-03-25 19:42 ` Vivek Goyal
2013-03-25 21:50 ` Yinghai Lu
2013-03-26 18:14 ` Vivek Goyal
2013-04-01 13:34 ` Vivek Goyal
2013-04-01 18:33 ` H. Peter Anvin
2013-04-01 19:26 ` Vivek Goyal
2013-04-01 20:47 ` H. Peter Anvin
2013-04-01 21:10 ` Yinghai Lu
2013-04-01 22:02 ` H. Peter Anvin
2013-04-01 22:17 ` Yinghai Lu
2013-04-01 22:20 ` H. Peter Anvin
2013-04-01 22:40 ` Yinghai Lu
2013-04-02 1:11 ` Yinghai Lu
2013-04-02 13:50 ` Vivek Goyal
2013-04-02 14:17 ` Vivek Goyal
2013-04-02 14:50 ` Yinghai Lu
2013-04-02 14:45 ` Yinghai Lu
2013-04-02 14:58 ` Vivek Goyal
2013-04-02 15:44 ` Yinghai Lu
2013-04-02 15:39 ` Vivek Goyal
2013-04-02 15:46 ` Yinghai Lu
2013-04-02 15:50 ` Vivek Goyal
2013-04-02 17:21 ` Yinghai Lu
2013-04-02 13:30 ` Vivek Goyal
2013-03-11 19:14 ` [PATCH] x86, kdump: Set crashkernel_low automatically Eric W. Biederman
2013-03-11 19:22 ` Vivek Goyal
2013-03-11 19:59 ` H. Peter Anvin
2013-03-11 20:17 ` Vivek Goyal
2013-03-11 19:56 ` H. Peter Anvin
2013-03-11 19:02 ` Vivek Goyal
2013-03-11 19:04 ` H. Peter Anvin
2013-03-11 19:17 ` Vivek Goyal
2013-03-11 13:14 ` 3.9-rc1: crash kernel panic - not syncing: Can not allocate SWIOTLB buffer earlier and can't now provide you with the DMA bounce buffer Konrad Rzeszutek Wilk
2013-03-08 7:52 ` Takao Indoh
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=CAE9FiQUu-AwKhsAdUautjxduW5a-pxpv8XFY-p1LWSmb-itATg@mail.gmail.com \
--to=yinghai@kernel.org \
--cc=chaowang@redhat.com \
--cc=ebiederm@xmission.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
--cc=vgoyal@redhat.com \
/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;
as well as URLs for NNTP newsgroup(s).