Skip to contentSkip to conversation

mm/page_alloc: fix the range check for backward merging

PATCH In review Kazuhisa Ichikawa 2 participants 2 messages Jan 3, 2010 – Jan 4, 2010

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

PATCH 1/1 mm/page_alloc: fix the range check for backward merging

From: Kazuhisa Ichikawa <[email protected]>

The current check for 'backward merging' within add_active_range() does not seem correct. start_pfn must be compared against early_node_map[i].start_pfn (and NOT against .end_pfn) to find out whether the new region is backward-mergeable with the existing range.

---
(This patch applies to linux-2.6.33-rc2)

mm/page_alloc.c +1 -1
@@ -3998,7 +3998,7 @@ void __init add_active_range(unsigned in
 		}
 
 		/* Merge backward if suitable */
-		if (start_pfn < early_node_map[i].end_pfn &&
+		if (start_pfn < early_node_map[i].start_pfn &&
 				end_pfn >= early_node_map[i].start_pfn) {
 			early_node_map[i].start_pfn = start_pfn;
 			return;

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

Acked-by on v1 1/1
#1 lore raw
Quoted 14 lines · Kazuhisa Ichikawa

From: Kazuhisa Ichikawa <[email protected]>

The current check for 'backward merging' within add_active_range() does not seem correct. start_pfn must be compared against early_node_map[i].start_pfn (and NOT against .end_pfn) to find out whether the new region is backward-mergeable with the existing range.

---
(This patch applies to linux-2.6.33-rc2)

mm/page_alloc.c void __init add_active_range(unsigned in · line 4004

Quoted 8 lines
mm/page_alloc.c +1 -1
@@ -3998,7 +3998,7 @@ void __init add_active_range(unsigned in
 		}
 
 		/* Merge backward if suitable */
-		if (start_pfn < early_node_map[i].end_pfn &&
+		if (start_pfn < early_node_map[i].start_pfn &&
 				end_pfn >= early_node_map[i].start_pfn) {
 			early_node_map[i].start_pfn = start_pfn;
 			return;