Commit d2dbe08ddceb4ba2b274abb84326d7e69d454e5c

Authored by Kazuhisa Ichikawa
Committed by Linus Torvalds
1 parent 5dab600e6a

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 <ki@epsilou.com>
Acked-by: David Rientjes <rientjes@google.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: Christoph Lameter <cl@linux-foundation.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

... ... @@ -3998,7 +3998,7 @@
3998 3998 }
3999 3999  
4000 4000 /* Merge backward if suitable */
4001   - if (start_pfn < early_node_map[i].end_pfn &&
  4001 + if (start_pfn < early_node_map[i].start_pfn &&
4002 4002 end_pfn >= early_node_map[i].start_pfn) {
4003 4003 early_node_map[i].start_pfn = start_pfn;
4004 4004 return;