kexec: make extended crashkernel= syntax less confusing

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Thursday, May 1, 2008 - 11:59 am

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=be089d...
Commit:     be089d79c46f5efa77fbdf03c5e576e220bf143f
Parent:     c85d194bfd2e36c5254b8058c1f35cfce0dfa10a
Author:     Michael Ellerman <michael@ellerman.id.au>
AuthorDate: Thu May 1 04:34:49 2008 -0700
Committer:  Linus Torvalds <torvalds@linux-foundation.org>
CommitDate: Thu May 1 08:04:00 2008 -0700

    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>
---
 Documentation/kdump/kdump.txt |    5 ++++-
 kernel/kexec.c                |    2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/Documentation/kdump/kdump.txt b/Documentation/kdump/kdump.txt
index d0ac72c..b8e52c0 100644
--- a/Documentation/kdump/kdump.txt
+++ b/Documentation/kdump/kdump.txt
@@ -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
@@ -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
 =======================
 
diff --git a/kernel/kexec.c b/kernel/kexec.c
index cb85c79..1c5fcac 100644
--- a/kernel/kexec.c
+++ b/kernel/kexec.c
@@ -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;
 		}
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
ahci: SB600 ahci can't do MSI, blacklist that capability, Linux Kernel Mailing ..., (Tue Apr 29, 4:01 pm)
kexec: make extended crashkernel= syntax less confusing, Linux Kernel Mailing ..., (Thu May 1, 11:59 am)