Re: x86 remap allocator in kernel 3.0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Dave,

I'm sorry, v4 is now missing the expansion of the strlen() argument. v5 (attached) should be the charm.

---
David Mair
SUSE Linux
In dump_memory_nodes() node_start_paddr is too small for all NUMA x86 
addresses. Those are 44 bits derived from a 32 bit read and PTOB() expands 
the result neatly to 64 bits. Standard x86 pages require a 32 bit read of
the physical address so a 32 bit local, temp_node_start_paddr, was added to 
retain the 32 bit read for the page-table field type and compiler expansion 
to 64 bits into the common local in dump_memory_nodes(). Another use of 
node_start_paddr was modified to assume 64 bits. I also modified the indent 
of node_start_paddr to use tabs like the preceding lines. Using the same crash 
dump Petr used in his test case I see that the vtop f2800080 output now 
includes struct page data in the last table that does not appear before this 
patch was added.

This patch is based on crash-6.0.2

Signed-off-by: David Mair <dmair@xxxxxxxx>
---
diff --git a/memory.c b/memory.c
index 95eefc9..430a4f4 100755
--- a/memory.c
+++ b/memory.c
@@ -13192,7 +13192,8 @@ dump_memory_nodes(int initialize)
 	int i, j;
 	int n, id, node, flen, slen, badaddr;
 	ulong node_mem_map;
-        ulong node_start_paddr;
+	ulong temp_node_start_paddr;
+	ulonglong node_start_paddr;
 	ulong node_start_pfn;
         ulong node_start_mapnr;
 	ulong node_spanned_pages, node_present_pages;
@@ -13286,10 +13287,12 @@ dump_memory_nodes(int initialize)
 			badaddr = TRUE;
 		}
 
-		if (VALID_MEMBER(pglist_data_node_start_paddr))
+		if (VALID_MEMBER(pglist_data_node_start_paddr)) {
 			readmem(pgdat+OFFSET(pglist_data_node_start_paddr), 
-				KVADDR, &node_start_paddr, sizeof(ulong), 
+				KVADDR, &temp_node_start_paddr, sizeof(ulong), 
 				"pglist node_start_paddr", FAULT_ON_ERROR);
+			node_start_paddr = temp_node_start_paddr;
+		}
 		else if (VALID_MEMBER(pglist_data_node_start_pfn)) {
 			readmem(pgdat+OFFSET(pglist_data_node_start_pfn), 
 				KVADDR, &node_start_pfn, sizeof(ulong), 
@@ -13394,14 +13397,14 @@ dump_memory_nodes(int initialize)
 				fprintf(fp, "%lx\n", node_zones);
 			}
 	
-	                fprintf(fp, "%s  START_PADDR  START_MAPNR\n",
+	                fprintf(fp, "%s     START_PADDR    START_MAPNR\n",
 	                    mkstring(buf1, VADDR_PRLEN, CENTER|LJUST, 
 				"MEM_MAP"));
 	                fprintf(fp, "%s  %s  %s\n",
 	                    mkstring(buf1, VADDR_PRLEN,
 	                        CENTER|LONG_HEX, MKSTR(node_mem_map)),
-	                    mkstring(buf2, strlen("START_PADDR"),
-	                        CENTER|LONG_HEX|RJUST, MKSTR(node_start_paddr)),
+	                    mkstring(buf2, strlen("   START_PADDR  "),
+	                        CENTER|LONGLONG_HEX|RJUST, MKSTR(&node_start_paddr)),
 	                    mkstring(buf3, strlen("START_MAPNR"),
 	                        CENTER|LONG_DEC|RJUST, 
 				    MKSTR(node_start_mapnr)));
--
Crash-utility mailing list
Crash-utility@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/crash-utility

[Index of Archives]     [Fedora Development]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]

 

Powered by Linux