Skip to content

Commit be089d7

Browse files
mpetorvalds
authored andcommitted
kexec: make extended crashkernel= syntax less confusing
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. [bwalle@suse.de: clarify inclusive/exclusive in crashkernel commandline in documentation] Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Acked-by: Bernhard Walle <bwalle@suse.de> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Cc: Simon Horman <horms@verge.net.au> Signed-off-by: Bernhard Walle <bwalle@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent c85d194 commit be089d7

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

‎Documentation/kdump/kdump.txt‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,8 @@ The syntax is:
245245
crashkernel=<range1>:<size1>[,<range2>:<size2>,...][@offset]
246246
range=start-[end]
247247

248+
'start' is inclusive and 'end' is exclusive.
249+
248250
For example:
249251

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

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

259261

262+
260263
Boot into System Kernel
261264
=======================
262265

‎kernel/kexec.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1217,7 +1217,7 @@ static int __init parse_crashkernel_mem(char *cmdline,
12171217
}
12181218

12191219
/* match ? */
1220-
if (system_ram >= start && system_ram <= end) {
1220+
if (system_ram >= start && system_ram < end) {
12211221
*crash_size = size;
12221222
break;
12231223
}

0 commit comments

Comments
 (0)