]> rtime.felk.cvut.cz Git - linux-imx.git/commit
mm: compaction: do not accidentally skip pageblocks in the migrate scanner
authorMel Gorman <mgorman@suse.de>
Sat, 23 Feb 2013 00:32:25 +0000 (16:32 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 24 Feb 2013 01:50:10 +0000 (17:50 -0800)
commita9aacbccf3145355190d87f0df1731fb84fdd8c8
tree52ac31c9be66f8114b3bff314fdc0802fce98f83
parent62b726c1b3cde6ab49304e8c1af41950ed855c3c
mm: compaction: do not accidentally skip pageblocks in the migrate scanner

Compaction uses the ALIGN macro incorrectly with the migrate scanner by
adding pageblock_nr_pages to a PFN.  It happened to work when initially
implemented as the starting PFN was also aligned but with caching
restarts and isolating in smaller chunks this is no longer always true.

The impact is that the migrate scanner scans outside its current
pageblock.  As pfn_valid() is still checked properly it does not cause
any failure and the impact of the bug is that in some cases it will scan
more than necessary when it crosses a page boundary but by no more than
COMPACT_CLUSTER_MAX.  It is highly unlikely this is even measurable but
it's still wrong so this patch addresses the problem.

Signed-off-by: Mel Gorman <mgorman@suse.de>
Reviewed-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/compaction.c