aboutsummaryrefslogtreecommitdiffstats
path: root/mm/compaction.c
diff options
context:
space:
mode:
authorRafael Aquini <aquini@redhat.com>2012-12-11 19:02:47 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-11 20:22:27 -0500
commit5733c7d11dff44e98d2ca16617886a78086b354f (patch)
tree2d7b982297b3be46b765123fad9d7d446b4cbdb3 /mm/compaction.c
parente22504296d4f64fbbbd741602ab47ee874649c18 (diff)
mm: introduce putback_movable_pages()
The PATCH "mm: introduce compaction and migration for virtio ballooned pages" hacks around putback_lru_pages() in order to allow ballooned pages to be re-inserted on balloon page list as if a ballooned page was like a LRU page. As ballooned pages are not legitimate LRU pages, this patch introduces putback_movable_pages() to properly cope with cases where the isolated pageset contains ballooned pages and LRU pages, thus fixing the mentioned inelegant hack around putback_lru_pages(). Signed-off-by: Rafael Aquini <aquini@redhat.com> Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: "Michael S. Tsirkin" <mst@redhat.com> Cc: Rik van Riel <riel@redhat.com> Cc: Mel Gorman <mel@csn.ul.ie> Cc: Andi Kleen <andi@firstfloor.org> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Cc: Minchan Kim <minchan@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/compaction.c')
-rw-r--r--mm/compaction.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/mm/compaction.c b/mm/compaction.c
index 470474c03b61..d24dd2d7bad4 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -1003,7 +1003,7 @@ static int compact_zone(struct zone *zone, struct compact_control *cc)
1003 switch (isolate_migratepages(zone, cc)) { 1003 switch (isolate_migratepages(zone, cc)) {
1004 case ISOLATE_ABORT: 1004 case ISOLATE_ABORT:
1005 ret = COMPACT_PARTIAL; 1005 ret = COMPACT_PARTIAL;
1006 putback_lru_pages(&cc->migratepages); 1006 putback_movable_pages(&cc->migratepages);
1007 cc->nr_migratepages = 0; 1007 cc->nr_migratepages = 0;
1008 goto out; 1008 goto out;
1009 case ISOLATE_NONE: 1009 case ISOLATE_NONE:
@@ -1026,9 +1026,9 @@ static int compact_zone(struct zone *zone, struct compact_control *cc)
1026 trace_mm_compaction_migratepages(nr_migrate - nr_remaining, 1026 trace_mm_compaction_migratepages(nr_migrate - nr_remaining,
1027 nr_remaining); 1027 nr_remaining);
1028 1028
1029 /* Release LRU pages not migrated */ 1029 /* Release isolated pages not migrated */
1030 if (err) { 1030 if (err) {
1031 putback_lru_pages(&cc->migratepages); 1031 putback_movable_pages(&cc->migratepages);
1032 cc->nr_migratepages = 0; 1032 cc->nr_migratepages = 0;
1033 if (err == -ENOMEM) { 1033 if (err == -ENOMEM) {
1034 ret = COMPACT_PARTIAL; 1034 ret = COMPACT_PARTIAL;