Skip to contentSkip to conversation

makedumpfile: s390x: Auto-detect the correct MAX_PHYSMEM_BITS used in vmcore being analyzed.

PATCH In review Mahesh J Salgaonkar 4 participants 6 messages Dec 20, 2011 – Jan 17, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 makedumpfile: s390x: Auto-detect the correct MAX_PHYSMEM_BITS used in vmcore being analyzed.

Hi Tachibana,

As part of the s390 patch to add support for > 4TB system memory (present in linux-next tree), the newer s390 kernel will bump the MAX_PHYSMEM_BITS from 42 to 46. Once that patch makes into umpstream kernel, this change will need to go into makedumpfile. For now, I am posting this patch for a review.

Reference: http://git.kernel.org/?p=linux/kernel/git/next/linux-next.git;a=commit;h=8980036860565a6d2a4f95bb097927e832fa3d1a

Thanks,
-Mahesh.

From: Mahesh Salgaonkar <[email protected]>

So far s390x kernel was using 42 bits for MAX_PHYSMEM_BITS that use to support maximum of 4TB of memory. In order to support bigger systems, the newer s390x kernel will now use 46 bits for MAX_PHYSMEM_BITS to support maximum of 64TB of memory.

This patch auto-detects the correct value to use for MAX_PHYSMEM_BITS by examining the mem_section array size from the vmcore being analyzed.

---
 arch/s390x.c   |   27 ++++++++++++++++++++++++++-
 makedumpfile.h |    3 ++-
 2 files changed, 28 insertions(+), 2 deletions(-)
arch/s390x.c +26 -1
index 9237eaa..c73220a 100644
@@ -60,6 +60,28 @@
 #define pte_offset(x)		(pte_index(x) * sizeof(unsigned long))
 
 int
+set_s390x_max_physmem_bits(void)
+{
+	long array_len = ARRAY_LENGTH(mem_section);
+	/*
+	 * The older s390x kernels uses _MAX_PHYSMEM_BITS as 42 and the
+	 * newer kernels uses 46 bits.
+	 */
+
+	info->max_physmem_bits  = _MAX_PHYSMEM_BITS_OLD;
+	if ((array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT_EXTREME()))
+		|| (array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT())))
+		return TRUE;
+
+	info->max_physmem_bits  = _MAX_PHYSMEM_BITS_NEW;
+	if ((array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT_EXTREME()))
+		|| (array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT())))
+		return TRUE;
+
+	return FALSE;
+}
+
+int
 get_machdep_info_s390x(void)
 {
 	unsigned long vmalloc_start;
@@ -70,7 +92,10 @@ get_machdep_info_s390x(void)
 		flag_ignore_r_char = 1;
 
 	info->section_size_bits = _SECTION_SIZE_BITS;
-	info->max_physmem_bits  = _MAX_PHYSMEM_BITS;
+	if (!set_s390x_max_physmem_bits()) {
+		ERRMSG("Can't detect max_physmem_bits.\n");
+		return FALSE;
+	}
 	info->page_offset = __PAGE_OFFSET;
 
 	if (SYMBOL(_stext) == NOT_FOUND_SYMBOL) {
makedumpfile.h +2 -1
index b3de521..a95d132 100644
@@ -531,7 +531,8 @@ do { \
 #define KERNELBASE		(0)
 #define KVBASE			KERNELBASE
 #define _SECTION_SIZE_BITS	(28)
-#define _MAX_PHYSMEM_BITS	(42)
+#define _MAX_PHYSMEM_BITS_OLD	(42)
+#define _MAX_PHYSMEM_BITS_NEW	(46)
 
 /* Bits in the segment/region table address-space-control-element */
 #define _ASCE_TYPE_MASK		0x0c

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#1 lore raw

Hello,

The s390 kernel patch is queued for the next merge window therefore will go upstream. My recommendation is to include the makedumpfile patch already now if it passes the review.

Best Regards

Michael

Quoted 80 lines · Mahesh J Salgaonkar

Hi Tachibana,

As part of the s390 patch to add support for > 4TB system memory (present in linux-next tree), the newer s390 kernel will bump the MAX_PHYSMEM_BITS from 42 to 46. Once that patch makes into umpstream kernel, this change will need to go into makedumpfile. For now, I am posting this patch for a review.

Reference: http://git.kernel.org/?p=linux/kernel/git/next/linux-next.git;a=commit;h=8980036860565a6d2a4f95bb097927e832fa3d1a

Thanks,
-Mahesh.

From: Mahesh Salgaonkar <[email protected]>

So far s390x kernel was using 42 bits for MAX_PHYSMEM_BITS that use to support maximum of 4TB of memory. In order to support bigger systems, the newer s390x kernel will now use 46 bits for MAX_PHYSMEM_BITS to support maximum of 64TB of memory.

This patch auto-detects the correct value to use for MAX_PHYSMEM_BITS by examining the mem_section array size from the vmcore being analyzed.

---
 arch/s390x.c   |   27 ++++++++++++++++++++++++++-
 makedumpfile.h |    3 ++-
 2 files changed, 28 insertions(+), 2 deletions(-)
arch/s390x.c +26 -1
index 9237eaa..c73220a 100644
@@ -60,6 +60,28 @@
 #define pte_offset(x)		(pte_index(x) * sizeof(unsigned long))
 
 int
+set_s390x_max_physmem_bits(void)
+{
+	long array_len = ARRAY_LENGTH(mem_section);
+	/*
+	 * The older s390x kernels uses _MAX_PHYSMEM_BITS as 42 and the
+	 * newer kernels uses 46 bits.
+	 */
+
+	info->max_physmem_bits  = _MAX_PHYSMEM_BITS_OLD;
+	if ((array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT_EXTREME()))
+		|| (array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT())))
+		return TRUE;
+
+	info->max_physmem_bits  = _MAX_PHYSMEM_BITS_NEW;
+	if ((array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT_EXTREME()))
+		|| (array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT())))
+		return TRUE;
+
+	return FALSE;
+}
+
+int
 get_machdep_info_s390x(void)
 {
 	unsigned long vmalloc_start;
@@ -70,7 +92,10 @@ get_machdep_info_s390x(void)
 		flag_ignore_r_char = 1;
 
 	info->section_size_bits = _SECTION_SIZE_BITS;
-	info->max_physmem_bits  = _MAX_PHYSMEM_BITS;
+	if (!set_s390x_max_physmem_bits()) {
+		ERRMSG("Can't detect max_physmem_bits.\n");
+		return FALSE;
+	}
 	info->page_offset = __PAGE_OFFSET;
 
 	if (SYMBOL(_stext) == NOT_FOUND_SYMBOL) {
makedumpfile.h +0 -0
index b3de521..a95d132 100644

makedumpfile.h do { \ · line 538

Quoted 9 lines
makedumpfile.h +2 -1
@@ -531,7 +531,8 @@ do { \
 #define KERNELBASE		(0)
 #define KVBASE			KERNELBASE
 #define _SECTION_SIZE_BITS	(28)
-#define _MAX_PHYSMEM_BITS	(42)
+#define _MAX_PHYSMEM_BITS_OLD	(42)
+#define _MAX_PHYSMEM_BITS_NEW	(46)
 
 /* Bits in the segment/region table address-space-control-element */
 #define _ASCE_TYPE_MASK		0x0c

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#2 lore raw

Re: [PATCH] makedumpfile: s390x: Auto-detect the correct MAX_PHYSMEM_BITSused in vmcore being analyzed.

In reply to Mahesh J Salgaonkar

Hi Mahesh,

Thank you for the patch.
I will review it.
However I have never dumped 1 terabyte or more data using makedumpfile. Has anyone ever dumped it successfully?

Thanks.
tachibana

Quoted 8 lines · Mahesh J Salgaonkar

Hi Tachibana,

As part of the s390 patch to add support for > 4TB system memory (present in linux-next tree), the newer s390 kernel will bump the MAX_PHYSMEM_BITS from 42 to 46. Once that patch makes into umpstream kernel, this change will need to go into makedumpfile. For now, I am posting this patch for a review.

Reference: http://git.kernel.org/?p=linux/kernel/git/next/linux-next.git;a=commit;h=8980036860565a6d2a4f95bb097927e832

fa3d1a

Quoted 72 lines

Thanks,
-Mahesh.

From: Mahesh Salgaonkar <[email protected]>

So far s390x kernel was using 42 bits for MAX_PHYSMEM_BITS that use to support maximum of 4TB of memory. In order to support bigger systems, the newer s390x kernel will now use 46 bits for MAX_PHYSMEM_BITS to support maximum of 64TB of memory.

This patch auto-detects the correct value to use for MAX_PHYSMEM_BITS by examining the mem_section array size from the vmcore being analyzed.

---
 arch/s390x.c   |   27 ++++++++++++++++++++++++++-
 makedumpfile.h |    3 ++-
 2 files changed, 28 insertions(+), 2 deletions(-)
arch/s390x.c +26 -1
index 9237eaa..c73220a 100644
@@ -60,6 +60,28 @@
 #define pte_offset(x)		(pte_index(x) * sizeof(unsigned long))
 
 int
+set_s390x_max_physmem_bits(void)
+{
+	long array_len = ARRAY_LENGTH(mem_section);
+	/*
+	 * The older s390x kernels uses _MAX_PHYSMEM_BITS as 42 and the
+	 * newer kernels uses 46 bits.
+	 */
+
+	info->max_physmem_bits  = _MAX_PHYSMEM_BITS_OLD;
+	if ((array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT_EXTREME()))
+		|| (array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT())))
+		return TRUE;
+
+	info->max_physmem_bits  = _MAX_PHYSMEM_BITS_NEW;
+	if ((array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT_EXTREME()))
+		|| (array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT())))
+		return TRUE;
+
+	return FALSE;
+}
+
+int
 get_machdep_info_s390x(void)
 {
 	unsigned long vmalloc_start;
@@ -70,7 +92,10 @@ get_machdep_info_s390x(void)
 		flag_ignore_r_char = 1;
 
 	info->section_size_bits = _SECTION_SIZE_BITS;
-	info->max_physmem_bits  = _MAX_PHYSMEM_BITS;
+	if (!set_s390x_max_physmem_bits()) {
+		ERRMSG("Can't detect max_physmem_bits.\n");
+		return FALSE;
+	}
 	info->page_offset = __PAGE_OFFSET;
 
 	if (SYMBOL(_stext) == NOT_FOUND_SYMBOL) {
makedumpfile.h +0 -0
index b3de521..a95d132 100644

makedumpfile.h do { \ · line 538

Quoted 9 lines
makedumpfile.h +2 -1
@@ -531,7 +531,8 @@ do { \
 #define KERNELBASE		(0)
 #define KVBASE			KERNELBASE
 #define _SECTION_SIZE_BITS	(28)
-#define _MAX_PHYSMEM_BITS	(42)
+#define _MAX_PHYSMEM_BITS_OLD	(42)
+#define _MAX_PHYSMEM_BITS_NEW	(46)
 
 /* Bits in the segment/region table address-space-control-element */
 #define _ASCE_TYPE_MASK		0x0c

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#3 lore raw

Re: [PATCH] makedumpfile: s390x: Auto-detect the correct MAX_PHYSMEM_BITSused in vmcore being analyzed.

Quoted 7 lines · On 12/21/2011 11:41 AM, [email protected] wrote:

Hi Mahesh,

Thank you for the patch.
I will review it.
However I have never dumped 1 terabyte or more data using makedumpfile. Has anyone ever dumped it successfully?

I have seen makedumpfile successfully compressing vmcore generated on system with 1TB memory.

Thanks,
-Mahesh.

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#4 lore raw

Re: [PATCH] makedumpfile: s390x: Auto-detect the correct MAX_PHYSMEM_BITSusedin vmcore being analyzed.

Hi Mahesh,

Quoted 11 lines · Mahesh Jagannath Salgaonkar
Quoted 7 lines · On 12/21/2011 11:41 AM, [email protected] wrote:

Hi Mahesh,

Thank you for the patch.
I will review it.
However I have never dumped 1 terabyte or more data using makedumpfile. Has anyone ever dumped it successfully?

I have seen makedumpfile successfully compressing vmcore generated on system with 1TB memory.

Thank you for your information.

Thanks.
tachibana

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#5 lore raw

Re: [PATCH] makedumpfile: s390x: Auto-detect the correct MAX_PHYSMEM_BITSusedin vmcore being analyzed.

Hi Mahesh,

Quoted 12 lines · On Wed, 21 Dec 2011 21:48:09 +0900 [email protected] wrote:

Hi Mahesh,

Quoted 9 lines · Mahesh Jagannath Salgaonkar
Quoted 7 lines · On 12/21/2011 11:41 AM, [email protected] wrote:

Hi Mahesh,

Thank you for the patch.
I will review it.
However I have never dumped 1 terabyte or more data using makedumpfile. Has anyone ever dumped it successfully?

Quoted 4 lines
Quoted 2 lines

I have seen makedumpfile successfully compressing vmcore generated on system with 1TB memory.

Thank you for your information.

I will merge your patch with renaming macros as:

_MAX_PHYSMEM_BITS_OLD -> _MAX_PHYSMEM_BITS_ORIG
_MAX_PHYSMEM_BITS_NEW -> _MAX_PHYSMEM_BITS_3_3

So, attached patch queued for makedumpfile-1.4.2.

Thanks
Atsushi Kumagai

From: Mahesh Salgaonkar <[email protected]>

So far s390x kernel was using 42 bits for MAX_PHYSMEM_BITS that use to support maximum of 4TB of memory. In order to support bigger systems, the newer s390x kernel will now use 46 bits for MAX_PHYSMEM_BITS to support maximum of 64TB of memory.

This patch auto-detects the correct value to use for MAX_PHYSMEM_BITS by examining the mem_section array size from the vmcore being analyzed.

Rename _MAX_PHYSMEM_BITS_OLD to _MAX_PHYSMEM_BITS_ORIG and _MAX_PHYSMEM_BITS_NEW to _MAX_PHYSMEM_BITS_3_3.

---
 arch/s390x.c   |   27 ++++++++++++++++++++++++++-
 makedumpfile.h |    3 ++-
 2 files changed, 28 insertions(+), 2 deletions(-)
arch/s390x.c +26 -1
index 9237eaa..02b9e63 100644
@@ -60,6 +60,28 @@
 #define pte_offset(x)		(pte_index(x) * sizeof(unsigned long))
 
 int
+set_s390x_max_physmem_bits(void)
+{
+	long array_len = ARRAY_LENGTH(mem_section);
+	/*
+	 * The older s390x kernels uses _MAX_PHYSMEM_BITS as 42 and the
+	 * newer kernels uses 46 bits.
+	 */
+
+	info->max_physmem_bits  = _MAX_PHYSMEM_BITS_ORIG ;
+	if ((array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT_EXTREME()))
+		|| (array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT())))
+		return TRUE;
+
+	info->max_physmem_bits  = _MAX_PHYSMEM_BITS_3_3;
+	if ((array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT_EXTREME()))
+		|| (array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT())))
+		return TRUE;
+
+	return FALSE;
+}
+
+int
 get_machdep_info_s390x(void)
 {
 	unsigned long vmalloc_start;
@@ -70,7 +92,10 @@ get_machdep_info_s390x(void)
 		flag_ignore_r_char = 1;
 
 	info->section_size_bits = _SECTION_SIZE_BITS;
-	info->max_physmem_bits  = _MAX_PHYSMEM_BITS;
+	if (!set_s390x_max_physmem_bits()) {
+		ERRMSG("Can't detect max_physmem_bits.\n");
+		return FALSE;
+	}
 	info->page_offset = __PAGE_OFFSET;
 
 	if (SYMBOL(_stext) == NOT_FOUND_SYMBOL) {
makedumpfile.h +2 -1
index 4b4a58b..ebb8929 100644
@@ -535,7 +535,8 @@ do { \
 #define KERNELBASE		(0)
 #define KVBASE			KERNELBASE
 #define _SECTION_SIZE_BITS	(28)
-#define _MAX_PHYSMEM_BITS	(42)
+#define _MAX_PHYSMEM_BITS_ORIG          (42)
+#define _MAX_PHYSMEM_BITS_3_3           (46)
 
 /* Bits in the segment/region table address-space-control-element */
 #define _ASCE_TYPE_MASK		0x0c
Signature · 6 lines
1.6.5.3

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec