From: Minchan Kim <minchan.kim@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm <linux-mm@kvack.org>,
LKML <linux-kernel@vger.kernel.org>, Mel Gorman <mel@csn.ul.ie>,
Minchan Kim <minchan.kim@gmail.com>
Subject: [PATCH 3/3] compaction: Check migrate_pages's return value instead of list_empty
Date: Fri, 21 Jan 2011 01:17:07 +0900 [thread overview]
Message-ID: <8d3d2470533ab99564cdcec88bfb7fcc96b383d3.1295539829.git.minchan.kim@gmail.com> (raw)
In-Reply-To: <f60d811fd1abcb68d40ac19af35881d700a97cd2.1295539829.git.minchan.kim@gmail.com>
In-Reply-To: <f60d811fd1abcb68d40ac19af35881d700a97cd2.1295539829.git.minchan.kim@gmail.com>
Many migrate_page's caller check return value instead of list_empy by
cf608ac19c95804dc2.
This patch makes compaction's migrate_pages consistent with others.
This patch should not change old behavior.
NOTE : This patch depends on [1/3].
Cc: Mel Gorman <mel@csn.ul.ie>
Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
---
mm/compaction.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/mm/compaction.c b/mm/compaction.c
index 6d592a0..cd0c7fc 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -497,12 +497,13 @@ static int compact_zone(struct zone *zone, struct compact_control *cc)
while ((ret = compact_finished(zone, cc)) == COMPACT_CONTINUE) {
unsigned long nr_migrate, nr_remaining;
+ int err;
if (!isolate_migratepages(zone, cc))
continue;
nr_migrate = cc->nr_migratepages;
- migrate_pages(&cc->migratepages, compaction_alloc,
+ err = migrate_pages(&cc->migratepages, compaction_alloc,
(unsigned long)cc, false,
cc->sync);
update_nr_listpages(cc);
@@ -516,7 +517,7 @@ static int compact_zone(struct zone *zone, struct compact_control *cc)
nr_remaining);
/* Release LRU pages not migrated */
- if (!list_empty(&cc->migratepages)) {
+ if (err) {
putback_lru_pages(&cc->migratepages);
cc->nr_migratepages = 0;
}
--
1.7.0.4
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2011-01-20 16:17 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-20 16:17 [PATCH 1/3] When migrate_pages returns 0, all pages must have been released Minchan Kim
2011-01-20 16:17 ` [PATCH 2/3] migration: Fix page corruption during hugepage migration Minchan Kim
2011-01-20 16:17 ` Minchan Kim [this message]
2011-01-26 8:18 ` [PATCH 3/3] compaction: Check migrate_pages's return value instead of list_empty Mel Gorman
2011-01-20 17:30 ` [PATCH 1/3] When migrate_pages returns 0, all pages must have been released Christoph Lameter
2011-01-20 18:24 ` Andrea Arcangeli
2011-01-20 18:49 ` Christoph Lameter
2011-01-20 21:28 ` Andrea Arcangeli
2011-01-21 16:11 ` Christoph Lameter
2011-01-21 17:36 ` Andrea Arcangeli
2011-01-21 23:54 ` Minchan Kim
2011-01-26 8:14 ` Mel Gorman
2011-01-26 23:06 ` Andrew Morton
2011-01-26 23:21 ` Minchan Kim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8d3d2470533ab99564cdcec88bfb7fcc96b383d3.1295539829.git.minchan.kim@gmail.com \
--to=minchan.kim@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mel@csn.ul.ie \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox