Skip to contentSkip to conversation

x86: keep the crash kernel below 896 MiB

PATCH In review Warner Wang 4 participants 4 messages Apr 25, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: keep the crash kernel below 896 MiB

When use the crashkernel=size parameter without specifying a "@xM" suffix, the crashkernel will be reserved at the highest suitable address of memory, this will make the kexec-tools fail to work. The current kexec-tools have a limitation that it can only work with crashkernel reserved under 896 MiB. we can increase this limit once kexec-tools are fixed.
Linux kernel itself have this code for kexec-tools limitation, so I think Xen code should also have it.

---
 xen/arch/x86/setup.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
xen/arch/x86/setup.c +7 -0
index 43301a5..ae4c947 100644
@@ -943,6 +943,13 @@ void __init __start_xen(unsigned long mbi_p)
             }
         }
 
+        /*
+         * Keep the crash kernel below this limit.  On 64 bits, kexec-tools
+         * currently limits us to 896 MiB; increase this limit once kexec-tools
+         * are fixed.
+         */
+        e = min_t(uint64_t, e, 896 << 20);
+
         /* Don't overlap with modules. */
         e = consider_modules(s, e, PAGE_ALIGN(kexec_crash_area.size),
                              mod, mbi->mods_count, -1);
Signature · 1 line
1.7.1
#1 lore raw
Quoted 9 lines
Quoted 1 line
Quoted 1 line · Warner Wang

When use the crashkernel=size parameter without specifying a "@xM" suffix, the crashkernel will be reserved at the highest suitable address of memory, this will make the kexec-tools fail to work. The current kexec-tools have a limitation that it can only work with crashkernel reserved under 896 MiB. we can increase this limit once kexec-tools are fixed.
Linux kernel itself have this code for kexec-tools limitation, so I think Xen code should also have it.

Andrew,

didn't you post something along those lines at some point too, yet there was a reason it never got applied?

Jan

Quoted 18 lines
xen/arch/x86/setup.c +7 -0
@@ -943,6 +943,13 @@ void __init __start_xen(unsigned long mbi_p)
             }
         }
 
+        /*
+         * Keep the crash kernel below this limit.  On 64 bits, kexec-tools
+         * currently limits us to 896 MiB; increase this limit once kexec-tools
+         * are fixed.
+         */
+        e = min_t(uint64_t, e, 896 << 20);
+
         /* Don't overlap with modules. */
         e = consider_modules(s, e, PAGE_ALIGN(kexec_crash_area.size),
                              mod, mbi->mods_count, -1);
Signature · 1 line
1.7.1
#2 lore raw
Quoted 9 lines · Jan Beulich
Quoted 9 lines
Quoted 1 line
Quoted 1 line · Warner Wang

When use the crashkernel=size parameter without specifying a "@xM" suffix, the crashkernel will be reserved at the highest suitable address of memory, this will make the kexec-tools fail to work. The current kexec-tools have a limitation that it can only work with crashkernel reserved under 896 MiB. we can increase this limit once kexec-tools are fixed.
Linux kernel itself have this code for kexec-tools limitation, so I think Xen code should also have it.

Quoted 6 lines

Andrew,

didn't you post something along those lines at some point too, yet there was a reason it never got applied?

Jan

Jan:
I have some low crashinfo patches but they are in. It was for positioning of the Xen per-cpu crash notes and the console ring.

Warner:
I am curious to know what this magic 896MiB limit is. Do you have a reference to the problem.

~Andrew

Quoted 21 lines
Quoted 19 lines
xen/arch/x86/setup.c +7 -0
@@ -943,6 +943,13 @@ void __init __start_xen(unsigned long mbi_p)
             }
         }
 
+        /*
+         * Keep the crash kernel below this limit.  On 64 bits, kexec-tools
+         * currently limits us to 896 MiB; increase this limit once kexec-tools
+         * are fixed.
+         */
+        e = min_t(uint64_t, e, 896 << 20);
+
         /* Don't overlap with modules. */
         e = consider_modules(s, e, PAGE_ALIGN(kexec_crash_area.size),
                              mod, mbi->mods_count, -1);
Signature · 1 line
1.7.1
#3 lore raw
In reply to Warner Wang
Quoted 8 lines · Warner Wang

When use the crashkernel=size parameter without specifying a "@xM" suffix, the crashkernel will be reserved at the highest suitable address of memory, this will make the kexec-tools fail to work. The current kexec-tools have a limitation that it can only work with crashkernel reserved under 896 MiB. we can increase this limit once kexec-tools are fixed.
Linux kernel itself have this code for kexec-tools limitation, so I think Xen code should also have it.

I don't think we should limit Xen in this way for any particular tool.

It's trivial to specify a location in the crashkernel parameter to work around this particular tool limitation.

I also think that this limitation may well be fixed as of kexec-tools 2.0.4. 64-bit kernels are now loaded above 4 GiB.

David

Quoted 23 lines
---
 xen/arch/x86/setup.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
xen/arch/x86/setup.c +7 -0
index 43301a5..ae4c947 100644
@@ -943,6 +943,13 @@ void __init __start_xen(unsigned long mbi_p)
             }
         }
 
+        /*
+         * Keep the crash kernel below this limit.  On 64 bits, kexec-tools
+         * currently limits us to 896 MiB; increase this limit once kexec-tools
+         * are fixed.
+         */
+        e = min_t(uint64_t, e, 896 << 20);
+
         /* Don't overlap with modules. */
         e = consider_modules(s, e, PAGE_ALIGN(kexec_crash_area.size),
                              mod, mbi->mods_count, -1);