[Crash-utility] [PATCH] Support linux-2.6.26 sparsemem kernel on i386.

Ken'ichi Ohmichi oomichi at mxs.nes.nec.co.jp
Thu Oct 16 09:34:47 UTC 2008


Hi Dave,

When 'kmem -p'/'kmem -i' is executed on i386 linux-2.6.26 sparsemem kernel,
current crash utility misunderstands the number of struct page in each
section and refers invalid struct page.

The cause is that SECTION_SIZE_BITS of PAE has been changed to 29 from 30
since linux-2.6.26 by the following:

[PATCH 3 of 4] sparsemem: reduce i386 PAE section size
http://www.uwsg.iu.edu/hypermail/linux/kernel/0803.3/1882.html

If applying the attached patch, the crash utility can catch up the
above change. It makes the results of both 'kmem -p' and 'kmem -i'
correct. The attached patch is for crash-4.0-7.4.

There is the same problem in makedumpfile, and I will fix it :-)


Thanks
Ken'ichi Ohmichi

Signed-off-by: Ken'ichi Ohmichi <oomichi at mxs.nes.nec.co.jp>
---
diff -rpuN crash-4.0-7.4.orig/defs.h crash-4.0-7.4/defs.h
--- crash-4.0-7.4.orig/defs.h	2008-10-16 17:32:46.000000000 +0900
+++ crash-4.0-7.4/defs.h	2008-10-16 17:46:30.000000000 +0900
@@ -2069,7 +2069,8 @@ struct load_module {
 #define TIF_SIGPENDING  (2)
 
 // CONFIG_X86_PAE 
-#define _SECTION_SIZE_BITS_PAE	30
+#define _SECTION_SIZE_BITS_PAE_ORIG	30
+#define _SECTION_SIZE_BITS_PAE_2_6_26	29
 #define _MAX_PHYSMEM_BITS_PAE	36
 
 // !CONFIG_X86_PAE   
diff -rpuN crash-4.0-7.4.orig/x86.c crash-4.0-7.4/x86.c
--- crash-4.0-7.4.orig/x86.c	2008-10-16 17:32:46.000000000 +0900
+++ crash-4.0-7.4/x86.c	2008-10-16 17:47:58.000000000 +0900
@@ -1819,7 +1819,12 @@ x86_init(int when)
 		}
 
 		if (machdep->flags & PAE) {
-			machdep->section_size_bits = _SECTION_SIZE_BITS_PAE;
+			if (THIS_KERNEL_VERSION < LINUX(2,6,26))
+				machdep->section_size_bits =
+					_SECTION_SIZE_BITS_PAE_ORIG;
+			else
+				machdep->section_size_bits =
+					_SECTION_SIZE_BITS_PAE_2_6_26;
 			machdep->max_physmem_bits = _MAX_PHYSMEM_BITS_PAE;
 		} else {
 			machdep->section_size_bits = _SECTION_SIZE_BITS;
_




More information about the Crash-utility mailing list