Skip to contentSkip to conversation

Documentation: Improve crashkernel= description

PATCH Superseded Ahmed S. Darwish 7 participants 13 messages Feb 6, 2011 – Feb 8, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Documentation: Improve crashkernel= description

(Also applicable over 2.6.38-rc3)

Had to explore two C code files to make sense of the 'crashkernel=' kernel parameter values. Improve the situation.

---

Documentation/kernel-parameters.txt +6 -3
index 89835a4..8f26b42 100644
@@ -545,9 +545,12 @@ and is between 256 and 4096 characters. It is defined in the file
 			Format:
 			<first_slot>,<last_slot>,<port>,<enum_bit>[,<debug>]
 
-	crashkernel=nn[KMG]@ss[KMG]
-			[KNL] Reserve a chunk of physical memory to
-			hold a kernel to switch to with kexec on panic.
+	crashkernel=size[KMG][@offset[KMG]]
+			[KNL] Using kexec, Linux can switch to a 'crash kernel'
+			upon panic. This parameter reserves the physical
+			memory region [offset, offset + size] for that kernel
+			image. If the '@offset' part was ignored, Linux finds
+			a suitable crash image start address automatically.
 
 	crashkernel=range1:size1[,range2:size2,...][@offset]
 			[KNL] Same as above, but depends on the memory

regards,

Signature · 7 lines
Darwish
http://darwish.07.googlepages.com

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
#1 lore raw
Quoted 15 lines · Ahmed S. Darwish

(Also applicable over 2.6.38-rc3)

Had to explore two C code files to make sense of the 'crashkernel=' kernel parameter values. Improve the situation.

---

Documentation/kernel-parameters.txt +0 -0
index 89835a4..8f26b42 100644
@@ -545,9 +545,12 @@ and is between 256 and 4096 characters. It is defined in the file
 			Format:
 			<first_slot>,<last_slot>,<port>,<enum_bit>[,<debug>]

Documentation/kernel-parameters.txt and is between 256 and 4096 characters. It is defined in the file · line 553

Quoted 10 lines
Documentation/kernel-parameters.txt +6 -3
 
-	crashkernel=nn[KMG]@ss[KMG]
-			[KNL] Reserve a chunk of physical memory to
-			hold a kernel to switch to with kexec on panic.
+	crashkernel=size[KMG][@offset[KMG]]
+			[KNL] Using kexec, Linux can switch to a 'crash kernel'
+			upon panic. This parameter reserves the physical
+			memory region [offset, offset + size] for that kernel
+			image. If the '@offset' part was ignored, Linux finds
+			a suitable crash image start address automatically.

I think this would be further improved as:

... If '@offset' is omitted then a suitable offset is selected automatically.

Quoted 4 lines
Documentation/kernel-parameters.txt +0 -0
 	crashkernel=range1:size1[,range2:size2,...][@offset]
 			[KNL] Same as above, but depends on the memory
 
Quoted 11 lines

regards,

Signature · 7 lines
Darwish
http://darwish.07.googlepages.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#2 lore raw
Quoted 29 lines · Simon Horman
Quoted 15 lines · Ahmed S. Darwish

(Also applicable over 2.6.38-rc3)

Had to explore two C code files to make sense of the 'crashkernel=' kernel parameter values. Improve the situation.

---

Documentation/kernel-parameters.txt +0 -0
index 89835a4..8f26b42 100644
@@ -545,9 +545,12 @@ and is between 256 and 4096 characters. It is defined in the file
 			Format:
 			<first_slot>,<last_slot>,<port>,<enum_bit>[,<debug>]

Documentation/kernel-parameters.txt and is between 256 and 4096 characters. It is defined in the file · line 553

Quoted 10 lines
Documentation/kernel-parameters.txt +6 -3
 
-	crashkernel=nn[KMG]@ss[KMG]
-			[KNL] Reserve a chunk of physical memory to
-			hold a kernel to switch to with kexec on panic.
+	crashkernel=size[KMG][@offset[KMG]]
+			[KNL] Using kexec, Linux can switch to a 'crash kernel'
+			upon panic. This parameter reserves the physical
+			memory region [offset, offset + size] for that kernel
+			image. If the '@offset' part was ignored, Linux finds
+			a suitable crash image start address automatically.

I think this would be further improved as:

Quoted 2 lines

... If '@offset' is omitted then a suitable offset is selected automatically.

Suitable offset as in parses a known image type (ELF, bzImage, etc) to find the start address? Or just assumes the entry point and load address are the same?

Is this the size for just the kernel image, or also for the physical memory it uses so it won't overwrite the existing kernel's stuff on the way up? (If a compressed kernel wants to decompress itself or extract an initramfs for itself, what happens?)

Rob

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#3 lore raw

Rob Landley <[email protected]> writes:

Quoted 29 lines · Simon Horman
Quoted 29 lines · Ahmed S. Darwish
Quoted 15 lines

(Also applicable over 2.6.38-rc3)

Had to explore two C code files to make sense of the 'crashkernel=' kernel parameter values. Improve the situation.

---

Documentation/kernel-parameters.txt +0 -0
index 89835a4..8f26b42 100644
@@ -545,9 +545,12 @@ and is between 256 and 4096 characters. It is defined in the file
 			Format:
 			<first_slot>,<last_slot>,<port>,<enum_bit>[,<debug>]

Documentation/kernel-parameters.txt and is between 256 and 4096 characters. It is defined in the file · line 553

Quoted 10 lines
Documentation/kernel-parameters.txt +6 -3
 
-	crashkernel=nn[KMG]@ss[KMG]
-			[KNL] Reserve a chunk of physical memory to
-			hold a kernel to switch to with kexec on panic.
+	crashkernel=size[KMG][@offset[KMG]]
+			[KNL] Using kexec, Linux can switch to a 'crash kernel'
+			upon panic. This parameter reserves the physical
+			memory region [offset, offset + size] for that kernel
+			image. If the '@offset' part was ignored, Linux finds
+			a suitable crash image start address automatically.

I think this would be further improved as:

Quoted 6 lines
Quoted 2 lines

... If '@offset' is omitted then a suitable offset is selected automatically.

Suitable offset as in parses a known image type (ELF, bzImage, etc) to find the start address? Or just assumes the entry point and load address are the same?

Neither. Suitable as in an offset that is naturally aligned for the size up to I think 16MB where the kernel doesn't care anymore. Saying that somewhere would be good but I don't think the definition of suitable belongs in a reference doc like kernel-parameters.txt

The important things for users is to know that they don't need to specify offset anymore.

Quoted 4 lines

Is this the size for just the kernel image, or also for the physical memory it uses so it won't overwrite the existing kernel's stuff on the way up? (If a compressed kernel wants to decompress itself or extract an initramfs for itself, what happens?)

The size is the size of the area reserved for the crash capture kernel to run in. The crash capture kernel never uses anything else.

All of the parsing etc is done in user space via /sbin/kexec.

Eric

#4 lore raw
In reply to Rob Landley
Quoted 30 lines · Rob Landley
Quoted 29 lines · Simon Horman
Quoted 15 lines · Ahmed S. Darwish

(Also applicable over 2.6.38-rc3)

Had to explore two C code files to make sense of the 'crashkernel=' kernel parameter values. Improve the situation.

---

Documentation/kernel-parameters.txt +0 -0
index 89835a4..8f26b42 100644
@@ -545,9 +545,12 @@ and is between 256 and 4096 characters. It is defined in the file
 			Format:
 			<first_slot>,<last_slot>,<port>,<enum_bit>[,<debug>]

Documentation/kernel-parameters.txt and is between 256 and 4096 characters. It is defined in the file · line 553

Quoted 10 lines
Documentation/kernel-parameters.txt +6 -3
 
-	crashkernel=nn[KMG]@ss[KMG]
-			[KNL] Reserve a chunk of physical memory to
-			hold a kernel to switch to with kexec on panic.
+	crashkernel=size[KMG][@offset[KMG]]
+			[KNL] Using kexec, Linux can switch to a 'crash kernel'
+			upon panic. This parameter reserves the physical
+			memory region [offset, offset + size] for that kernel
+			image. If the '@offset' part was ignored, Linux finds
+			a suitable crash image start address automatically.

I think this would be further improved as:

Quoted 6 lines
Quoted 2 lines

... If '@offset' is omitted then a suitable offset is selected automatically.

Suitable offset as in parses a known image type (ELF, bzImage, etc) to find the start address? Or just assumes the entry point and load address are the same?

As in it finds a large enough area of contiguous free memory. I believe that originally it searched from the bottom of memory, it may be slightly smarter now.

Suitable is perhaps too strong a term.

In terms of the start address. On x86 at least it used to be important to make sure that the start address matched but these days using a relocatable kernel is an easier option.

Quoted 4 lines

Is this the size for just the kernel image, or also for the physical memory it uses so it won't overwrite the existing kernel's stuff on the way up? (If a compressed kernel wants to decompress itself or extract an initramfs for itself, what happens?)

It is the memory that is used by the crash-kernel to avoid overwriting the first-kernel's stuff. It is not the memory where the (usually compressed) second-kernel is stored before it is kexeced.

If a compressed crash-kernel wants to decompress itself it does so in the available memory which is the region reserved by the crash-kernel parameter to the first-kernel.

#5 lore raw
Quoted 34 lines · Simon Horman
Quoted 33 lines · Rob Landley
Quoted 31 lines · Simon Horman
Quoted 15 lines · Ahmed S. Darwish

(Also applicable over 2.6.38-rc3)

Had to explore two C code files to make sense of the 'crashkernel=' kernel parameter values. Improve the situation.

---

Documentation/kernel-parameters.txt +0 -0
index 89835a4..8f26b42 100644
@@ -545,9 +545,12 @@ and is between 256 and 4096 characters. It is defined in the file
 			Format:
 			<first_slot>,<last_slot>,<port>,<enum_bit>[,<debug>]

Documentation/kernel-parameters.txt and is between 256 and 4096 characters. It is defined in the file · line 553

Quoted 10 lines
Documentation/kernel-parameters.txt +6 -3
 
-	crashkernel=nn[KMG]@ss[KMG]
-			[KNL] Reserve a chunk of physical memory to
-			hold a kernel to switch to with kexec on panic.
+	crashkernel=size[KMG][@offset[KMG]]
+			[KNL] Using kexec, Linux can switch to a 'crash kernel'
+			upon panic. This parameter reserves the physical
+			memory region [offset, offset + size] for that kernel
+			image. If the '@offset' part was ignored, Linux finds
+			a suitable crash image start address automatically.

I think this would be further improved as:

... If '@offset' is omitted then a suitable offset is selected automatically.

Quoted 7 lines
Quoted 3 lines

Suitable offset as in parses a known image type (ELF, bzImage, etc) to find the start address? Or just assumes the entry point and load address are the same?

As in it finds a large enough area of contiguous free memory. I believe that originally it searched from the bottom of memory, it may be slightly smarter now.

Now it has been changed to search from top of the memory (atleast for x86) and that caused few troubles. On 32bit it searches for memory under 512MB and on x86_64, it searches for memory under 896MB.

Though hpa had suggested to enhance the command line syntax such that a user specifies the upper bound on memory. Something like crashkernel=x < y. So reserve X amount of memory below y MB. It boils down to same thing that somebody has to know that what is the maximum physical memory locaton kernel can boot from.

I think it is dependent on kernel as well as dependent on kexec-tools. I am wondering if it is possible to make this info part of bzImage protocol where kernel tells bootloader the maximum physical memory kernel can be loaded at. I think this is off topic in the context of this patch, just a thought...

Thanks
Vivek

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#6 lore raw
In reply to Rob Landley
Quoted 4 lines · Rob Landley

Suitable offset as in parses a known image type (ELF, bzImage, etc) to find the start address? Or just assumes the entry point and load address are the same?

No, that is the start physical address of crashkernel, which should be your system RAM not reserved by your BIOS etc..

The beginning of the physical memory is often fragmented, thus specifying a fixed offset may not work on a specific machine.

Quoted 6 lines

Is this the size for just the kernel image, or also for the physical memory it uses so it won't overwrite the existing kernel's stuff on the way up? (If a compressed kernel wants to decompress itself or extract an initramfs for itself, what happens?)

The size means the whole physical memory size available to the second kernel (i.e. crash kernel), which includes the memory occupied by vmlinuz, initrd, *and* the memory which will be used by the programs inside initrd (e.g. /sbin/init). If this memory is not sufficient, you will get OOM.

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#7 lore raw
In reply to Simon Horman
Quoted 29 lines · On Mon, 7 Feb 2011 06:57:33 +0900 Simon Horman wrote:
Quoted 15 lines · Ahmed S. Darwish

(Also applicable over 2.6.38-rc3)

Had to explore two C code files to make sense of the 'crashkernel=' kernel parameter values. Improve the situation.

---

Documentation/kernel-parameters.txt +0 -0
index 89835a4..8f26b42 100644
@@ -545,9 +545,12 @@ and is between 256 and 4096 characters. It is defined in the file
 			Format:
 			<first_slot>,<last_slot>,<port>,<enum_bit>[,<debug>]

Documentation/kernel-parameters.txt and is between 256 and 4096 characters. It is defined in the file · line 553

Quoted 10 lines
Documentation/kernel-parameters.txt +6 -3
 
-	crashkernel=nn[KMG]@ss[KMG]
-			[KNL] Reserve a chunk of physical memory to
-			hold a kernel to switch to with kexec on panic.
+	crashkernel=size[KMG][@offset[KMG]]
+			[KNL] Using kexec, Linux can switch to a 'crash kernel'
+			upon panic. This parameter reserves the physical
+			memory region [offset, offset + size] for that kernel
+			image. If the '@offset' part was ignored, Linux finds
+			a suitable crash image start address automatically.

I think this would be further improved as:

Quoted 6 lines

... If '@offset' is omitted then a suitable offset is selected automatically.

Quoted 3 lines
Documentation/kernel-parameters.txt +0 -0
 	crashkernel=range1:size1[,range2:size2,...][@offset]
 			[KNL] Same as above, but depends on the memory

Hi,

I also prefer Simon's change. Can you please resend an updated patch?

thanks,
---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

#8 lore raw

PATCH v2 1/1 Documentation: Improve crashkernel= description

Had to explore two C code files to make sense of the 'crashkernel=' kernel parameter values. Improve the situation.

---

Documentation/kernel-parameters.txt +6 -3
index 89835a4..5ad9980 100644
@@ -545,9 +545,12 @@ and is between 256 and 4096 characters. It is defined in the file
 			Format:
 			<first_slot>,<last_slot>,<port>,<enum_bit>[,<debug>]
 
-	crashkernel=nn[KMG]@ss[KMG]
-			[KNL] Reserve a chunk of physical memory to
-			hold a kernel to switch to with kexec on panic.
+	crashkernel=size[KMG][@offset[KMG]]
+			[KNL] Using kexec, Linux can switch to a 'crash kernel'
+			upon panic. This parameter reserves the physical
+			memory region [offset, offset + size] for that kernel
+			image. If '@offset' is omitted, then a suitable offset
+			is selected automatically.
 
 	crashkernel=range1:size1[,range2:size2,...][@offset]
 			[KNL] Same as above, but depends on the memory
Signature · 7 lines
Darwish
http://darwish.07.googlepages.com

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Acked-by on v2 1/1
#9 lore raw
Quoted 5 lines · Ahmed S. Darwish

Had to explore two C code files to make sense of the 'crashkernel=' kernel parameter values. Improve the situation.

Thanks, that looks looks a good improvement over the existing documentation.

Quoted 27 lines

---

Documentation/kernel-parameters.txt +6 -3
index 89835a4..5ad9980 100644
@@ -545,9 +545,12 @@ and is between 256 and 4096 characters. It is defined in the file
 			Format:
 			<first_slot>,<last_slot>,<port>,<enum_bit>[,<debug>]
 
-	crashkernel=nn[KMG]@ss[KMG]
-			[KNL] Reserve a chunk of physical memory to
-			hold a kernel to switch to with kexec on panic.
+	crashkernel=size[KMG][@offset[KMG]]
+			[KNL] Using kexec, Linux can switch to a 'crash kernel'
+			upon panic. This parameter reserves the physical
+			memory region [offset, offset + size] for that kernel
+			image. If '@offset' is omitted, then a suitable offset
+			is selected automatically.
 
 	crashkernel=range1:size1[,range2:size2,...][@offset]
 			[KNL] Same as above, but depends on the memory
Signature · 3 lines
-- 
Darwish
http://darwish.07.googlepages.com

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

Acked-by on v2 1/1
#10 lore raw
In reply to Ahmed S. Darwish
Quoted 4 lines · Ahmed S. Darwish

Had to explore two C code files to make sense of the 'crashkernel=' kernel parameter values. Improve the situation.

Did you look at Documentation/kdump/kdump.txt before looking into the code. I thought kdump.txt explained the meaning of crashkernel= well.

In case if it was not obivious that for further details look into kdump.txt, I will suggest to add a line asking reader to look into kdump.txt for more details.

Tough crashkernel= range1:size1[,range2:size2,...][@offset], description in next line already mentions kdump.txt

This patch looks good to me as it is though.

Vivek

Quoted 27 lines

---

Documentation/kernel-parameters.txt +6 -3
index 89835a4..5ad9980 100644
@@ -545,9 +545,12 @@ and is between 256 and 4096 characters. It is defined in the file
 			Format:
 			<first_slot>,<last_slot>,<port>,<enum_bit>[,<debug>]
 
-	crashkernel=nn[KMG]@ss[KMG]
-			[KNL] Reserve a chunk of physical memory to
-			hold a kernel to switch to with kexec on panic.
+	crashkernel=size[KMG][@offset[KMG]]
+			[KNL] Using kexec, Linux can switch to a 'crash kernel'
+			upon panic. This parameter reserves the physical
+			memory region [offset, offset + size] for that kernel
+			image. If '@offset' is omitted, then a suitable offset
+			is selected automatically.
 
 	crashkernel=range1:size1[,range2:size2,...][@offset]
 			[KNL] Same as above, but depends on the memory
Signature · 3 lines
-- 
Darwish
http://darwish.07.googlepages.com

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#11 lore raw

PATCH v3 1/1 Documentation: Improve crashkernel= description

Quoted 6 lines · Vivek Goyal
Quoted 4 lines · Ahmed S. Darwish

Had to explore two C code files to make sense of the 'crashkernel=' kernel parameter values. Improve the situation.

Quoted 7 lines

Did you look at Documentation/kdump/kdump.txt before looking into the code. I thought kdump.txt explained the meaning of crashkernel= well.

In case if it was not obivious that for further details look into kdump.txt, I will suggest to add a line asking reader to look into kdump.txt for more details.

Yes, I jumped to the code first :-) Here's a new patch with the link:

(Also applicable over latest -rc3)

==>

Complete the crashkernel= kernel parameter documentation.

---

Documentation/kernel-parameters.txt +8 -4
index 89835a4..050b0e5 100644
@@ -545,16 +545,20 @@ and is between 256 and 4096 characters. It is defined in the file
 			Format:
 			<first_slot>,<last_slot>,<port>,<enum_bit>[,<debug>]
 
-	crashkernel=nn[KMG]@ss[KMG]
-			[KNL] Reserve a chunk of physical memory to
-			hold a kernel to switch to with kexec on panic.
+	crashkernel=size[KMG][@offset[KMG]]
+			[KNL] Using kexec, Linux can switch to a 'crash kernel'
+			upon panic. This parameter reserves the physical
+			memory region [offset, offset + size] for that kernel
+			image. If '@offset' is omitted, then a suitable offset
+			is selected automatically. Check
+			Documentation/kdump/kdump.txt for further details.
 
 	crashkernel=range1:size1[,range2:size2,...][@offset]
 			[KNL] Same as above, but depends on the memory
 			in the running system. The syntax of range is
 			start-[end] where start and end are both
 			a memory unit (amount[KMG]). See also
-			Documentation/kdump/kdump.txt for a example.
+			Documentation/kdump/kdump.txt for an example.
 
 	cs89x0_dma=	[HW,NET]
 			Format: <dma>
Quoted 3 lines

thanks,

Signature · 7 lines
Darwish
http://darwish.07.googlepages.com

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Applied
#12 lore raw
Quoted 58 lines · On Mon, 7 Feb 2011 18:01:27 +0200 Ahmed S. Darwish wrote:
Quoted 6 lines · Vivek Goyal
Quoted 4 lines · Ahmed S. Darwish

Had to explore two C code files to make sense of the 'crashkernel=' kernel parameter values. Improve the situation.

Quoted 7 lines

Did you look at Documentation/kdump/kdump.txt before looking into the code. I thought kdump.txt explained the meaning of crashkernel= well.

In case if it was not obivious that for further details look into kdump.txt, I will suggest to add a line asking reader to look into kdump.txt for more details.

Yes, I jumped to the code first :-) Here's a new patch with the link:

(Also applicable over latest -rc3)

==>

Complete the crashkernel= kernel parameter documentation.

---

Documentation/kernel-parameters.txt +8 -4
index 89835a4..050b0e5 100644
@@ -545,16 +545,20 @@ and is between 256 and 4096 characters. It is defined in the file
 			Format:
 			<first_slot>,<last_slot>,<port>,<enum_bit>[,<debug>]
 
-	crashkernel=nn[KMG]@ss[KMG]
-			[KNL] Reserve a chunk of physical memory to
-			hold a kernel to switch to with kexec on panic.
+	crashkernel=size[KMG][@offset[KMG]]
+			[KNL] Using kexec, Linux can switch to a 'crash kernel'
+			upon panic. This parameter reserves the physical
+			memory region [offset, offset + size] for that kernel
+			image. If '@offset' is omitted, then a suitable offset
+			is selected automatically. Check
+			Documentation/kdump/kdump.txt for further details.
 
 	crashkernel=range1:size1[,range2:size2,...][@offset]
 			[KNL] Same as above, but depends on the memory
 			in the running system. The syntax of range is
 			start-[end] where start and end are both
 			a memory unit (amount[KMG]). See also
-			Documentation/kdump/kdump.txt for a example.
+			Documentation/kdump/kdump.txt for an example.
 
 	cs89x0_dma=	[HW,NET]
 			Format: <dma>
Quoted 3 lines
Quoted 1 line
Quoted 1 line

Applied v3, along with your KMG info patch. Thanks.

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***