Skip to contentSkip to conversation

fix node offsets into zone_table[]

PATCH New William Lee Irwin III 1 participant 1 message Feb 15, 2002

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix node offsets into zone_table[]

Against rmap12f
free_area_init_core() initializes zone_table[] with no node offset, and sets the zone of a page using pgdat->nid (uninitialized on entry to free_area_init_core()) as a node number.

Bug and fix reported by Samuel Ortiz.

Cheers,
Bill

# This is a BitKeeper generated patch for the following project:
# Project Name: Long-term Linux VM development
# This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas:
# ChangeSet 1.198 ->
# mm/page_alloc.c 1.58 -> 1.59
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/02/14 [email protected] 1.199
# Fix zone_table[] initialization bugs where zone_table uses either no node offset

# for the index or an uninitialized field of pgdat as a node number.
# --------------------------------------------
#
diff -Nru a/mm/page_alloc.c b/mm/page_alloc.c
--- a/mm/page_alloc.c	Thu Feb 14 17:51:19 2002
+++ b/mm/page_alloc.c	Thu Feb 14 17:51:19 2002
@@ -897,7 +897,7 @@
 		unsigned long mask, extrafree = 0;
 		unsigned long size, realsize;

- zone_table[j] = zone;
+ zone_table[nid * MAX_NR_ZONES + j] = zone;
realsize = size = zones_size[j];
if (zholes_size)
realsize -= zholes_size[j];
@@ -982,7 +982,7 @@
*/
for (i = 0; i < size; i++) {
struct page *page = mem_map + offset + i;
- set_page_zone(page, pgdat->node_id * MAX_NR_ZONES + j);
+ set_page_zone(page, nid * MAX_NR_ZONES + j);
init_page_count(page); __SetPageReserved(page); memlist_init(&page->list);