From: Kazuhisa Ichikawa Date: Sat, 16 Jan 2010 01:01:20 +0000 (-0800) Subject: mm/page_alloc: fix the range check for backward merging X-Git-Tag: v2.6.33-rc5~47 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=d2dbe08ddceb4ba2b274abb84326d7e69d454e5c;p=~emulex%2Finfiniband.git mm/page_alloc: fix the range check for backward merging 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. Signed-off-by: Kazuhisa Ichikawa Acked-by: David Rientjes Cc: KOSAKI Motohiro Cc: Mel Gorman Cc: Christoph Lameter Cc: Johannes Weiner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 4e9f5cc5fb5..6ea4966a633 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -3998,7 +3998,7 @@ void __init add_active_range(unsigned int nid, unsigned long start_pfn, } /* 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;