All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] Documentation: Improve crashkernel= description
@ 2011-02-06 15:41 ` Ahmed S. Darwish
  0 siblings, 0 replies; 25+ messages in thread
From: Ahmed S. Darwish @ 2011-02-06 15:41 UTC (permalink / raw)
  To: Randy Dunlap, Vivek Goyal, Haren Myneni
  Cc: Eric Biederman, kexec, LKML, linux-doc

(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.

Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
---

diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 89835a4..8f26b42 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -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,

-- 
Darwish
http://darwish.07.googlepages.com

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH -next] Documentation: Improve crashkernel= description
@ 2011-02-06 15:41 ` Ahmed S. Darwish
  0 siblings, 0 replies; 25+ messages in thread
From: Ahmed S. Darwish @ 2011-02-06 15:41 UTC (permalink / raw)
  To: Randy Dunlap, Vivek Goyal, Haren Myneni
  Cc: linux-doc, kexec, Eric Biederman, LKML

(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.

Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
---

diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 89835a4..8f26b42 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -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,

-- 
Darwish
http://darwish.07.googlepages.com

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* Re: [PATCH -next] Documentation: Improve crashkernel= description
  2011-02-06 15:41 ` Ahmed S. Darwish
@ 2011-02-06 21:57   ` Simon Horman
  -1 siblings, 0 replies; 25+ messages in thread
From: Simon Horman @ 2011-02-06 21:57 UTC (permalink / raw)
  To: Ahmed S. Darwish
  Cc: Randy Dunlap, Vivek Goyal, Haren Myneni, Eric Biederman, kexec,
	LKML, linux-doc

On Sun, Feb 06, 2011 at 05:41:08PM +0200, Ahmed S. Darwish wrote:
> (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.
> 
> Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
> ---
> 
> diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
> index 89835a4..8f26b42 100644
> --- a/Documentation/kernel-parameters.txt
> +++ b/Documentation/kernel-parameters.txt
> @@ -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.

I think this would be further improved as:

			... 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
> 
> regards,
> 
> -- 
> Darwish
> http://darwish.07.googlepages.com
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH -next] Documentation: Improve crashkernel= description
@ 2011-02-06 21:57   ` Simon Horman
  0 siblings, 0 replies; 25+ messages in thread
From: Simon Horman @ 2011-02-06 21:57 UTC (permalink / raw)
  To: Ahmed S. Darwish
  Cc: linux-doc, kexec, LKML, Haren Myneni, Randy Dunlap,
	Eric Biederman, Vivek Goyal

On Sun, Feb 06, 2011 at 05:41:08PM +0200, Ahmed S. Darwish wrote:
> (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.
> 
> Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
> ---
> 
> diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
> index 89835a4..8f26b42 100644
> --- a/Documentation/kernel-parameters.txt
> +++ b/Documentation/kernel-parameters.txt
> @@ -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.

I think this would be further improved as:

			... 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
> 
> regards,
> 
> -- 
> Darwish
> http://darwish.07.googlepages.com
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH -next] Documentation: Improve crashkernel= description
  2011-02-06 21:57   ` Simon Horman
@ 2011-02-07  2:25     ` Rob Landley
  -1 siblings, 0 replies; 25+ messages in thread
From: Rob Landley @ 2011-02-07  2:25 UTC (permalink / raw)
  To: Simon Horman
  Cc: Ahmed S. Darwish, Randy Dunlap, Vivek Goyal, Haren Myneni,
	Eric Biederman, kexec, LKML, linux-doc

On 02/06/2011 03:57 PM, Simon Horman wrote:
> On Sun, Feb 06, 2011 at 05:41:08PM +0200, Ahmed S. Darwish wrote:
>> (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.
>>
>> Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
>> ---
>>
>> diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
>> index 89835a4..8f26b42 100644
>> --- a/Documentation/kernel-parameters.txt
>> +++ b/Documentation/kernel-parameters.txt
>> @@ -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.
> 
> I think this would be further improved as:
> 
> 			... 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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH -next] Documentation: Improve crashkernel= description
@ 2011-02-07  2:25     ` Rob Landley
  0 siblings, 0 replies; 25+ messages in thread
From: Rob Landley @ 2011-02-07  2:25 UTC (permalink / raw)
  To: Simon Horman
  Cc: linux-doc, kexec, LKML, Ahmed S. Darwish, Haren Myneni,
	Randy Dunlap, Eric Biederman, Vivek Goyal

On 02/06/2011 03:57 PM, Simon Horman wrote:
> On Sun, Feb 06, 2011 at 05:41:08PM +0200, Ahmed S. Darwish wrote:
>> (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.
>>
>> Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
>> ---
>>
>> diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
>> index 89835a4..8f26b42 100644
>> --- a/Documentation/kernel-parameters.txt
>> +++ b/Documentation/kernel-parameters.txt
>> @@ -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.
> 
> I think this would be further improved as:
> 
> 			... 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
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH -next] Documentation: Improve crashkernel= description
  2011-02-07  2:25     ` Rob Landley
@ 2011-02-07  2:35       ` Eric W. Biederman
  -1 siblings, 0 replies; 25+ messages in thread
From: Eric W. Biederman @ 2011-02-07  2:35 UTC (permalink / raw)
  To: Rob Landley
  Cc: Simon Horman, Ahmed S. Darwish, Randy Dunlap, Vivek Goyal,
	Haren Myneni, kexec, LKML, linux-doc

Rob Landley <rlandley@parallels.com> writes:

2> On 02/06/2011 03:57 PM, Simon Horman wrote:
>> On Sun, Feb 06, 2011 at 05:41:08PM +0200, Ahmed S. Darwish wrote:
>>> (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.
>>>
>>> Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
>>> ---
>>>
>>> diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
>>> index 89835a4..8f26b42 100644
>>> --- a/Documentation/kernel-parameters.txt
>>> +++ b/Documentation/kernel-parameters.txt
>>> @@ -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.
>> 
>> I think this would be further improved as:
>> 
>> 			... 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.

> 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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH -next] Documentation: Improve crashkernel= description
@ 2011-02-07  2:35       ` Eric W. Biederman
  0 siblings, 0 replies; 25+ messages in thread
From: Eric W. Biederman @ 2011-02-07  2:35 UTC (permalink / raw)
  To: Rob Landley
  Cc: linux-doc, kexec, LKML, Ahmed S. Darwish, Haren Myneni,
	Randy Dunlap, Simon Horman, Vivek Goyal

Rob Landley <rlandley@parallels.com> writes:

2> On 02/06/2011 03:57 PM, Simon Horman wrote:
>> On Sun, Feb 06, 2011 at 05:41:08PM +0200, Ahmed S. Darwish wrote:
>>> (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.
>>>
>>> Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
>>> ---
>>>
>>> diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
>>> index 89835a4..8f26b42 100644
>>> --- a/Documentation/kernel-parameters.txt
>>> +++ b/Documentation/kernel-parameters.txt
>>> @@ -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.
>> 
>> I think this would be further improved as:
>> 
>> 			... 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.

> 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

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH -next] Documentation: Improve crashkernel= description
  2011-02-07  2:25     ` Rob Landley
@ 2011-02-07  2:42       ` Simon Horman
  -1 siblings, 0 replies; 25+ messages in thread
From: Simon Horman @ 2011-02-07  2:42 UTC (permalink / raw)
  To: Rob Landley
  Cc: linux-doc, kexec, LKML, Ahmed S. Darwish, Haren Myneni,
	Randy Dunlap, Eric Biederman, Vivek Goyal

On Sun, Feb 06, 2011 at 08:25:20PM -0600, Rob Landley wrote:
> On 02/06/2011 03:57 PM, Simon Horman wrote:
> > On Sun, Feb 06, 2011 at 05:41:08PM +0200, Ahmed S. Darwish wrote:
> >> (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.
> >>
> >> Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
> >> ---
> >>
> >> diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
> >> index 89835a4..8f26b42 100644
> >> --- a/Documentation/kernel-parameters.txt
> >> +++ b/Documentation/kernel-parameters.txt
> >> @@ -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.
> > 
> > I think this would be further improved as:
> > 
> > 			... 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.

> 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.

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH -next] Documentation: Improve crashkernel= description
@ 2011-02-07  2:42       ` Simon Horman
  0 siblings, 0 replies; 25+ messages in thread
From: Simon Horman @ 2011-02-07  2:42 UTC (permalink / raw)
  To: Rob Landley
  Cc: linux-doc, kexec, LKML, Ahmed S. Darwish, Haren Myneni,
	Randy Dunlap, Eric Biederman, Vivek Goyal

On Sun, Feb 06, 2011 at 08:25:20PM -0600, Rob Landley wrote:
> On 02/06/2011 03:57 PM, Simon Horman wrote:
> > On Sun, Feb 06, 2011 at 05:41:08PM +0200, Ahmed S. Darwish wrote:
> >> (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.
> >>
> >> Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
> >> ---
> >>
> >> diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
> >> index 89835a4..8f26b42 100644
> >> --- a/Documentation/kernel-parameters.txt
> >> +++ b/Documentation/kernel-parameters.txt
> >> @@ -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.
> > 
> > I think this would be further improved as:
> > 
> > 			... 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.

> 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.

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH -next] Documentation: Improve crashkernel= description
  2011-02-06 21:57   ` Simon Horman
@ 2011-02-07  4:14     ` Randy Dunlap
  -1 siblings, 0 replies; 25+ messages in thread
From: Randy Dunlap @ 2011-02-07  4:14 UTC (permalink / raw)
  To: Simon Horman
  Cc: Ahmed S. Darwish, Vivek Goyal, Haren Myneni, Eric Biederman,
	kexec, LKML, linux-doc

On Mon, 7 Feb 2011 06:57:33 +0900 Simon Horman wrote:

> On Sun, Feb 06, 2011 at 05:41:08PM +0200, Ahmed S. Darwish wrote:
> > (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.
> > 
> > Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
> > ---
> > 
> > diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
> > index 89835a4..8f26b42 100644
> > --- a/Documentation/kernel-parameters.txt
> > +++ b/Documentation/kernel-parameters.txt
> > @@ -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.
> 
> I think this would be further improved as:
> 
> 			... 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

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 ***

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH -next] Documentation: Improve crashkernel= description
@ 2011-02-07  4:14     ` Randy Dunlap
  0 siblings, 0 replies; 25+ messages in thread
From: Randy Dunlap @ 2011-02-07  4:14 UTC (permalink / raw)
  To: Simon Horman
  Cc: linux-doc, kexec, LKML, Ahmed S. Darwish, Haren Myneni,
	Eric Biederman, Vivek Goyal

On Mon, 7 Feb 2011 06:57:33 +0900 Simon Horman wrote:

> On Sun, Feb 06, 2011 at 05:41:08PM +0200, Ahmed S. Darwish wrote:
> > (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.
> > 
> > Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
> > ---
> > 
> > diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
> > index 89835a4..8f26b42 100644
> > --- a/Documentation/kernel-parameters.txt
> > +++ b/Documentation/kernel-parameters.txt
> > @@ -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.
> 
> I think this would be further improved as:
> 
> 			... 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

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 ***

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH -next] Documentation: Improve crashkernel= description
  2011-02-07  2:25     ` Rob Landley
                       ` (2 preceding siblings ...)
  (?)
@ 2011-02-07 10:59     ` WANG Cong
  -1 siblings, 0 replies; 25+ messages in thread
From: WANG Cong @ 2011-02-07 10:59 UTC (permalink / raw)
  To: kexec; +Cc: linux-kernel, linux-doc

On Sun, 06 Feb 2011 20:25:20 -0600, Rob Landley wrote:

> 
> 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.

> 
> 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
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [PATCH v2 -next] Documentation: Improve crashkernel= description
  2011-02-07  4:14     ` Randy Dunlap
@ 2011-02-07 11:30       ` Ahmed S. Darwish
  -1 siblings, 0 replies; 25+ messages in thread
From: Ahmed S. Darwish @ 2011-02-07 11:30 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: Simon Horman, Vivek Goyal, Haren Myneni, Eric Biederman, kexec,
	LKML, linux-doc


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

Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
---

diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 89835a4..5ad9980 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -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

-- 
Darwish
http://darwish.07.googlepages.com

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH v2 -next] Documentation: Improve crashkernel= description
@ 2011-02-07 11:30       ` Ahmed S. Darwish
  0 siblings, 0 replies; 25+ messages in thread
From: Ahmed S. Darwish @ 2011-02-07 11:30 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: linux-doc, kexec, LKML, Haren Myneni, Simon Horman,
	Eric Biederman, Vivek Goyal


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

Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
---

diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 89835a4..5ad9980 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -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

-- 
Darwish
http://darwish.07.googlepages.com

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* Re: [PATCH v2 -next] Documentation: Improve crashkernel= description
  2011-02-07 11:30       ` Ahmed S. Darwish
@ 2011-02-07 11:41         ` Simon Horman
  -1 siblings, 0 replies; 25+ messages in thread
From: Simon Horman @ 2011-02-07 11:41 UTC (permalink / raw)
  To: Ahmed S. Darwish
  Cc: Randy Dunlap, Vivek Goyal, Haren Myneni, Eric Biederman, kexec,
	LKML, linux-doc

On Mon, Feb 07, 2011 at 01:30:54PM +0200, Ahmed S. Darwish wrote:
> 
> Had to explore two C code files to make sense of the 'crashkernel='
> kernel parameter values.  Improve the situation.
> 
> Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>

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

Acked-by: Simon Horman <horms@verge.net.au>

> ---
> 
> diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
> index 89835a4..5ad9980 100644
> --- a/Documentation/kernel-parameters.txt
> +++ b/Documentation/kernel-parameters.txt
> @@ -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
> 
> -- 
> Darwish
> http://darwish.07.googlepages.com
> 

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH v2 -next] Documentation: Improve crashkernel= description
@ 2011-02-07 11:41         ` Simon Horman
  0 siblings, 0 replies; 25+ messages in thread
From: Simon Horman @ 2011-02-07 11:41 UTC (permalink / raw)
  To: Ahmed S. Darwish
  Cc: linux-doc, kexec, LKML, Haren Myneni, Randy Dunlap,
	Eric Biederman, Vivek Goyal

On Mon, Feb 07, 2011 at 01:30:54PM +0200, Ahmed S. Darwish wrote:
> 
> Had to explore two C code files to make sense of the 'crashkernel='
> kernel parameter values.  Improve the situation.
> 
> Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>

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

Acked-by: Simon Horman <horms@verge.net.au>

> ---
> 
> diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
> index 89835a4..5ad9980 100644
> --- a/Documentation/kernel-parameters.txt
> +++ b/Documentation/kernel-parameters.txt
> @@ -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
> 
> -- 
> Darwish
> http://darwish.07.googlepages.com
> 

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH v2 -next] Documentation: Improve crashkernel= description
  2011-02-07 11:30       ` Ahmed S. Darwish
@ 2011-02-07 14:25         ` Vivek Goyal
  -1 siblings, 0 replies; 25+ messages in thread
From: Vivek Goyal @ 2011-02-07 14:25 UTC (permalink / raw)
  To: Ahmed S. Darwish
  Cc: Randy Dunlap, Simon Horman, Haren Myneni, Eric Biederman, kexec,
	LKML, linux-doc

On Mon, Feb 07, 2011 at 01:30:54PM +0200, Ahmed S. Darwish wrote:
> 
> 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.

Acked-by: Vivek Goyal <vgoyal@redhat.com>

Vivek

> Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
> ---
> 
> diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
> index 89835a4..5ad9980 100644
> --- a/Documentation/kernel-parameters.txt
> +++ b/Documentation/kernel-parameters.txt
> @@ -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
> 
> -- 
> Darwish
> http://darwish.07.googlepages.com

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH v2 -next] Documentation: Improve crashkernel= description
@ 2011-02-07 14:25         ` Vivek Goyal
  0 siblings, 0 replies; 25+ messages in thread
From: Vivek Goyal @ 2011-02-07 14:25 UTC (permalink / raw)
  To: Ahmed S. Darwish
  Cc: linux-doc, kexec, LKML, Haren Myneni, Randy Dunlap, Simon Horman,
	Eric Biederman

On Mon, Feb 07, 2011 at 01:30:54PM +0200, Ahmed S. Darwish wrote:
> 
> 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.

Acked-by: Vivek Goyal <vgoyal@redhat.com>

Vivek

> Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
> ---
> 
> diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
> index 89835a4..5ad9980 100644
> --- a/Documentation/kernel-parameters.txt
> +++ b/Documentation/kernel-parameters.txt
> @@ -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
> 
> -- 
> Darwish
> http://darwish.07.googlepages.com

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH -next] Documentation: Improve crashkernel= description
  2011-02-07  2:42       ` Simon Horman
@ 2011-02-07 14:33         ` Vivek Goyal
  -1 siblings, 0 replies; 25+ messages in thread
From: Vivek Goyal @ 2011-02-07 14:33 UTC (permalink / raw)
  To: Simon Horman
  Cc: Rob Landley, linux-doc, kexec, LKML, Ahmed S. Darwish,
	Haren Myneni, Randy Dunlap, Eric Biederman, H. Peter Anvin

On Mon, Feb 07, 2011 at 11:42:38AM +0900, Simon Horman wrote:
> On Sun, Feb 06, 2011 at 08:25:20PM -0600, Rob Landley wrote:
> > On 02/06/2011 03:57 PM, Simon Horman wrote:
> > > On Sun, Feb 06, 2011 at 05:41:08PM +0200, Ahmed S. Darwish wrote:
> > >> (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.
> > >>
> > >> Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
> > >> ---
> > >>
> > >> diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
> > >> index 89835a4..8f26b42 100644
> > >> --- a/Documentation/kernel-parameters.txt
> > >> +++ b/Documentation/kernel-parameters.txt
> > >> @@ -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.
> > > 
> > > I think this would be further improved as:
> > > 
> > > 			... 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.

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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH -next] Documentation: Improve crashkernel= description
@ 2011-02-07 14:33         ` Vivek Goyal
  0 siblings, 0 replies; 25+ messages in thread
From: Vivek Goyal @ 2011-02-07 14:33 UTC (permalink / raw)
  To: Simon Horman
  Cc: linux-doc, Rob Landley, kexec, LKML, Ahmed S. Darwish,
	Haren Myneni, Randy Dunlap, Eric Biederman, H. Peter Anvin

On Mon, Feb 07, 2011 at 11:42:38AM +0900, Simon Horman wrote:
> On Sun, Feb 06, 2011 at 08:25:20PM -0600, Rob Landley wrote:
> > On 02/06/2011 03:57 PM, Simon Horman wrote:
> > > On Sun, Feb 06, 2011 at 05:41:08PM +0200, Ahmed S. Darwish wrote:
> > >> (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.
> > >>
> > >> Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
> > >> ---
> > >>
> > >> diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
> > >> index 89835a4..8f26b42 100644
> > >> --- a/Documentation/kernel-parameters.txt
> > >> +++ b/Documentation/kernel-parameters.txt
> > >> @@ -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.
> > > 
> > > I think this would be further improved as:
> > > 
> > > 			... 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.

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
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [PATCH v3 -next] Documentation: Improve crashkernel= description
  2011-02-07 14:25         ` Vivek Goyal
@ 2011-02-07 16:01           ` Ahmed S. Darwish
  -1 siblings, 0 replies; 25+ messages in thread
From: Ahmed S. Darwish @ 2011-02-07 16:01 UTC (permalink / raw)
  To: Vivek Goyal
  Cc: Randy Dunlap, Simon Horman, Haren Myneni, Eric Biederman, kexec,
	LKML, linux-doc

On Mon, Feb 07, 2011 at 09:25:50AM -0500, Vivek Goyal wrote:
> On Mon, Feb 07, 2011 at 01:30:54PM +0200, Ahmed S. Darwish wrote:
> > 
> > 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.
> 

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.

Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
---

diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 89835a4..050b0e5 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -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>


> 
> Acked-by: Vivek Goyal <vgoyal@redhat.com>
> 

thanks,

-- 
Darwish
http://darwish.07.googlepages.com

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH v3 -next] Documentation: Improve crashkernel= description
@ 2011-02-07 16:01           ` Ahmed S. Darwish
  0 siblings, 0 replies; 25+ messages in thread
From: Ahmed S. Darwish @ 2011-02-07 16:01 UTC (permalink / raw)
  To: Vivek Goyal
  Cc: linux-doc, kexec, LKML, Haren Myneni, Randy Dunlap, Simon Horman,
	Eric Biederman

On Mon, Feb 07, 2011 at 09:25:50AM -0500, Vivek Goyal wrote:
> On Mon, Feb 07, 2011 at 01:30:54PM +0200, Ahmed S. Darwish wrote:
> > 
> > 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.
> 

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.

Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
---

diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 89835a4..050b0e5 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -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>


> 
> Acked-by: Vivek Goyal <vgoyal@redhat.com>
> 

thanks,

-- 
Darwish
http://darwish.07.googlepages.com

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* Re: [PATCH v3 -next] Documentation: Improve crashkernel= description
  2011-02-07 16:01           ` Ahmed S. Darwish
@ 2011-02-08 18:50             ` Randy Dunlap
  -1 siblings, 0 replies; 25+ messages in thread
From: Randy Dunlap @ 2011-02-08 18:50 UTC (permalink / raw)
  To: Ahmed S. Darwish
  Cc: Vivek Goyal, Simon Horman, Haren Myneni, Eric Biederman, kexec,
	LKML, linux-doc

On Mon, 7 Feb 2011 18:01:27 +0200 Ahmed S. Darwish wrote:

> On Mon, Feb 07, 2011 at 09:25:50AM -0500, Vivek Goyal wrote:
> > On Mon, Feb 07, 2011 at 01:30:54PM +0200, Ahmed S. Darwish wrote:
> > > 
> > > 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.
> > 
> 
> 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.
> 
> Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
> ---
> 
> diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
> index 89835a4..050b0e5 100644
> --- a/Documentation/kernel-parameters.txt
> +++ b/Documentation/kernel-parameters.txt
> @@ -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>
> 
> 
> > 
> > Acked-by: Vivek Goyal <vgoyal@redhat.com>


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

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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH v3 -next] Documentation: Improve crashkernel= description
@ 2011-02-08 18:50             ` Randy Dunlap
  0 siblings, 0 replies; 25+ messages in thread
From: Randy Dunlap @ 2011-02-08 18:50 UTC (permalink / raw)
  To: Ahmed S. Darwish
  Cc: linux-doc, kexec, LKML, Haren Myneni, Simon Horman,
	Eric Biederman, Vivek Goyal

On Mon, 7 Feb 2011 18:01:27 +0200 Ahmed S. Darwish wrote:

> On Mon, Feb 07, 2011 at 09:25:50AM -0500, Vivek Goyal wrote:
> > On Mon, Feb 07, 2011 at 01:30:54PM +0200, Ahmed S. Darwish wrote:
> > > 
> > > 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.
> > 
> 
> 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.
> 
> Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
> ---
> 
> diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
> index 89835a4..050b0e5 100644
> --- a/Documentation/kernel-parameters.txt
> +++ b/Documentation/kernel-parameters.txt
> @@ -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>
> 
> 
> > 
> > Acked-by: Vivek Goyal <vgoyal@redhat.com>


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

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

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2011-02-08 18:51 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-06 15:41 [PATCH -next] Documentation: Improve crashkernel= description Ahmed S. Darwish
2011-02-06 15:41 ` Ahmed S. Darwish
2011-02-06 21:57 ` Simon Horman
2011-02-06 21:57   ` Simon Horman
2011-02-07  2:25   ` Rob Landley
2011-02-07  2:25     ` Rob Landley
2011-02-07  2:35     ` Eric W. Biederman
2011-02-07  2:35       ` Eric W. Biederman
2011-02-07  2:42     ` Simon Horman
2011-02-07  2:42       ` Simon Horman
2011-02-07 14:33       ` Vivek Goyal
2011-02-07 14:33         ` Vivek Goyal
2011-02-07 10:59     ` WANG Cong
2011-02-07  4:14   ` Randy Dunlap
2011-02-07  4:14     ` Randy Dunlap
2011-02-07 11:30     ` [PATCH v2 " Ahmed S. Darwish
2011-02-07 11:30       ` Ahmed S. Darwish
2011-02-07 11:41       ` Simon Horman
2011-02-07 11:41         ` Simon Horman
2011-02-07 14:25       ` Vivek Goyal
2011-02-07 14:25         ` Vivek Goyal
2011-02-07 16:01         ` [PATCH v3 " Ahmed S. Darwish
2011-02-07 16:01           ` Ahmed S. Darwish
2011-02-08 18:50           ` Randy Dunlap
2011-02-08 18:50             ` Randy Dunlap

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.