Dave Anderson wrote:
I originally thought this might come up, as evidenced by
the fact that I initialize the "pglist_data_node_present_pages"
member offset, but don't use it anywere.
Let me tinker with this for a while...
This patch should do it...
Dave
--- crash-4.0-3.12/defs.h.orig 2006-11-21 10:01:36.000000000 -0500
+++ crash-4.0-3.12/defs.h 2006-11-21 10:01:49.000000000 -0500
@@ -1541,6 +1541,7 @@
ulong pgdat;
ulong mem_map;
ulong size;
+ ulong present;
ulonglong start_paddr;
ulong start_mapnr;
};
--- crash-4.0-3.12/memory.c.orig 2006-11-21 10:02:20.000000000 -0500
+++ crash-4.0-3.12/memory.c 2006-11-21 10:02:45.000000000 -0500
@@ -10150,6 +10150,7 @@
fprintf(fp, " id: %d\n", nt->node_id);
fprintf(fp, " pgdat: %lx\n", nt->pgdat);
fprintf(fp, " size: %ld\n", nt->size);
+ fprintf(fp, " present: %ld\n", nt->present);
fprintf(fp, " mem_map: %lx\n", nt->mem_map);
fprintf(fp, " start_paddr: %llx\n", nt->start_paddr);
fprintf(fp, " start_mapnr: %ld\n", nt->start_mapnr);
@@ -10223,12 +10224,16 @@
console(" id: %d\n", nt->node_id);
console(" pgdat: %lx\n", nt->pgdat);
console(" size: %ld\n", nt->size);
+ console(" present: %ld\n", nt->present);
console(" mem_map: %lx\n", nt->mem_map);
console(" start_paddr: %lx\n", nt->start_paddr);
console(" start_mapnr: %ld\n", nt->start_mapnr);
}
- total += (uint64_t)((uint64_t)nt->size * (uint64_t)PAGESIZE());
+ if (nt->present)
+ total += (uint64_t)((uint64_t)nt->present * (uint64_t)PAGESIZE());
+ else
+ total += (uint64_t)((uint64_t)nt->size * (uint64_t)PAGESIZE());
}
return total;
@@ -11122,7 +11127,7 @@
ulong node_start_paddr;
ulong node_start_pfn;
ulong node_start_mapnr;
- ulong node_spanned_pages;
+ ulong node_spanned_pages, node_present_pages;
ulong free_pages, zone_size, node_size, cum_zone_size;
ulong zone_start_paddr, zone_start_mapnr, zone_mem_map;
physaddr_t phys;
@@ -11155,6 +11160,7 @@
fprintf(fp, " id: %d\n", nt->node_id);
fprintf(fp, " pgdat: %lx\n", nt->pgdat);
fprintf(fp, " size: %ld\n", nt->size);
+ fprintf(fp, " present: %ld\n", nt->present);
fprintf(fp, " mem_map: %lx\n", nt->mem_map);
fprintf(fp, " start_paddr: %llx\n",
nt->start_paddr);
fprintf(fp, " start_mapnr: %ld\n",
nt->start_mapnr);
@@ -11238,6 +11244,13 @@
node_size = node_spanned_pages;
} else error(INFO, "cannot determine zone size\n");
+ if (VALID_MEMBER(pglist_data_node_present_pages))
+ readmem(pgdat+OFFSET(pglist_data_node_present_pages),
+ KVADDR, &node_present_pages, sizeof(ulong),
+ "pglist node_present_pages", FAULT_ON_ERROR);
+ else
+ node_present_pages = 0;
+
readmem(pgdat+OFFSET(pglist_data_bdata), KVADDR, &bdata,
sizeof(ulong), "pglist bdata", FAULT_ON_ERROR);
@@ -11248,6 +11261,7 @@
nt->size = 0; /* initialize below */
else
nt->size = node_size;
+ nt->present = node_present_pages;
nt->mem_map = node_mem_map;
nt->start_paddr = node_start_paddr;
nt->start_mapnr = node_start_mapnr;
@@ -11257,6 +11271,7 @@
fprintf(fp, " id: %d\n", nt->node_id);
fprintf(fp, " pgdat: %lx\n", nt->pgdat);
fprintf(fp, " size: %ld\n", nt->size);
+ fprintf(fp, " present: %ld\n", nt->present);
fprintf(fp, " mem_map: %lx\n", nt->mem_map);
fprintf(fp, " start_paddr: %llx\n", nt->start_paddr);
fprintf(fp, " start_mapnr: %ld\n", nt->start_mapnr);