Skip to content

Commit

Permalink
[PATCH] Calculation fix for memory holes beyong the end of physical m…
Browse files Browse the repository at this point in the history
…emory

absent_pages_in_range() made the assumption that users of the
arch-independent zone-sizing API would not care about holes beyound the end
of physical memory.  This was not the case and was "fixed" in a patch
called "Account for holes that are outside the range of physical memory".
However, when given a range that started before a hole in "real" memory and
ended beyond the end of memory, it would get the result wrong.  The bug is
in mainline but a patch is below.

It has been tested successfully on a number of machines and architectures.
Additional credit to Keith Mannthey for discovering the problem, helping
identify the correct fix and confirming it Worked For Him.

Signed-off-by: Mel Gorman <mel@csn.ul.ie>
Cc: keith mannthey <kmannth@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Mel Gorman authored and Linus Torvalds committed Oct 28, 2006
1 parent 057647f commit 0c6cb97
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mm/page_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2261,7 +2261,7 @@ unsigned long __init __absent_pages_in_range(int nid,

/* Account for ranges past physical memory on this node */
if (range_end_pfn > prev_end_pfn)
hole_pages = range_end_pfn -
hole_pages += range_end_pfn -
max(range_start_pfn, prev_end_pfn);

return hole_pages;
Expand Down

0 comments on commit 0c6cb97

Please sign in to comment.