Skip to content

Commit

Permalink
kexec: make extended crashkernel= syntax less confusing
Browse files Browse the repository at this point in the history
The extended crashkernel syntax is a little confusing in the way it handles
ranges.  eg:

 crashkernel=512M-2G:64M,2G-:128M

Means if the machine has between 512M and 2G of memory the crash region should
be 64M, and if the machine has 2G of memory the region should be 64M.  Only if
the machine has more than 2G memory will 128M be allocated.

Although that semantic is correct, it is somewhat baffling.  Instead I propose
that the end of the range means the first address past the end of the range,
ie: 512M up to but not including 2G.

[[email protected]: clarify inclusive/exclusive in crashkernel commandline in documentation]
Signed-off-by: Michael Ellerman <[email protected]>
Acked-by: Bernhard Walle <[email protected]>
Cc: "Eric W. Biederman" <[email protected]>
Cc: Simon Horman <[email protected]>
Signed-off-by: Bernhard Walle <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
mpe authored and torvalds committed May 1, 2008
1 parent c85d194 commit be089d7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion Documentation/kdump/kdump.txt
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,8 @@ The syntax is:
crashkernel=<range1>:<size1>[,<range2>:<size2>,...][@offset]
range=start-[end]

'start' is inclusive and 'end' is exclusive.

For example:

crashkernel=512M-2G:64M,2G-:128M
Expand All @@ -253,10 +255,11 @@ This would mean:

1) if the RAM is smaller than 512M, then don't reserve anything
(this is the "rescue" case)
2) if the RAM size is between 512M and 2G, then reserve 64M
2) if the RAM size is between 512M and 2G (exclusive), then reserve 64M
3) if the RAM size is larger than 2G, then reserve 128M



Boot into System Kernel
=======================

Expand Down
2 changes: 1 addition & 1 deletion kernel/kexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1217,7 +1217,7 @@ static int __init parse_crashkernel_mem(char *cmdline,
}

/* match ? */
if (system_ram >= start && system_ram <= end) {
if (system_ram >= start && system_ram < end) {
*crash_size = size;
break;
}
Expand Down

0 comments on commit be089d7

Please sign in to comment.