Hi.
This patch fixes the bug so that makedumpfile can search free_area by
each zone.
Thanks
Ken'ichi Ohmichi
diff -puN makedumpfile.org/makedumpfile.c makedumpfile/makedumpfile.c
--- makedumpfile.org/makedumpfile.c 2006-10-11 13:43:11.000000000 +0900
+++ makedumpfile/makedumpfile.c 2006-10-11 14:00:02.000000000 +0900
@@ -1914,10 +1914,8 @@ reset_bitmap_of_free_pages(struct DumpIn
int
dump_memory_nodes(struct DumpInfo *info)
{
- int node, n, i;
- unsigned long node_zones, spanned_pages, pgdat;
-
- vt->nr_zones = MAX_NR_ZONES;
+ int i, num_nodes, node;
+ unsigned long node_zones, zone, spanned_pages, pgdat;
/*
* In case that (vt->flags & NODES_ONLINE) is 1.
@@ -1930,35 +1928,35 @@ dump_memory_nodes(struct DumpInfo *info)
ERRMSG("Can't get pgdat list.\n");
return FALSE;
}
- for (n = 0; pgdat; n++) {
- if (n >= vt->numnodes) {
+ for (num_nodes = 1;; num_nodes++) {
+ if (num_nodes > vt->numnodes) {
ERRMSG("numnodes out of sync with pgdat_list\n");
return FALSE;
}
node_zones = pgdat + OFFSET(pglist_data.node_zones);
- for (i = 0; i < vt->nr_zones; i++) {
- if (!readmem(info,node_zones+OFFSET(zone.spanned_pages),
+ for (i = 0; i < MAX_NR_ZONES; i++) {
+ zone = node_zones + (i * SIZE(zone));
+ if (!readmem(info, zone + OFFSET(zone.spanned_pages),
&spanned_pages, sizeof spanned_pages)) {
ERRMSG("Can't get spanned_pages.\n");
return FALSE;
}
if (!spanned_pages)
continue;
- if (!reset_bitmap_of_free_pages(info, node_zones))
+ if (!reset_bitmap_of_free_pages(info, zone))
return FALSE;
- node_zones += SIZE(zone);
}
if (vt->flags & NODES_ONLINE) {
- if ((node = next_online_node(node+1)) < 0)
- pgdat = 0; /* Exit the loop. */
+ if ((node = next_online_node(node + 1)) < 0)
+ break;
else if (!(pgdat = next_online_pgdat(info, node))) {
- ERRMSG("Cannot determine pgdat list (node
%d)\n\n",
+ ERRMSG("Can't determine pgdat list (node
%d).\n",
node);
return FALSE;
}
}
}
- if (n != vt->numnodes) {
+ if (num_nodes != vt->numnodes) {
ERRMSG("numnodes out of sync with pgdat_list\n");
return FALSE;
}
diff -puN makedumpfile.org/makedumpfile.h makedumpfile/makedumpfile.h
--- makedumpfile.org/makedumpfile.h 2006-10-11 13:43:11.000000000 +0900
+++ makedumpfile/makedumpfile.h 2006-10-11 13:47:29.000000000 +0900
@@ -340,7 +340,7 @@ do { \
#define DEFAULT_PHYS_START (KERNEL_TR_PAGE_SIZE * 1)
#define _SECTION_SIZE_BITS (30)
#define SIZEOF_NODE_ONLINE_MAP (32)
-#define MAX_ORDER (18)
+#define MAX_ORDER (17)
#endif /* ia64 */
/*
@@ -473,7 +473,6 @@ struct DumpInfo {
struct vm_table { /* kernel VM-related data */
ulong flags;
int numnodes;
- int nr_zones;
int nr_free_areas;
ulong *node_online_map;
int node_online_map_len;
_
_______________________________________________
fastboot mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/fastboot