linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Gioh Kim <gioh.kim@lge.com>
To: jlayton@poochiereds.net, bfields@fieldses.org, vbabka@suse.cz,
	iamjoonsoo.kim@lge.com, viro@zeniv.linux.org.uk, mst@redhat.com,
	koct9i@gmail.com, minchan@kernel.org, aquini@redhat.com,
	linux-fsdevel@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-kernel@vger.kernel.org, linux-api@vger.kernel.org,
	linux-mm@kvack.org
Cc: gunho.lee@lge.com, akpm@linux-foundation.org,
	Gioh Kim <gurugio@hanmail.net>, Gioh Kim <gioh.kim@lge.com>
Subject: [RFCv3 4/5] mm: call generic migration callbacks
Date: Tue,  7 Jul 2015 13:36:24 +0900	[thread overview]
Message-ID: <1436243785-24105-5-git-send-email-gioh.kim@lge.com> (raw)
In-Reply-To: <1436243785-24105-1-git-send-email-gioh.kim@lge.com>

From: Gioh Kim <gurugio@hanmail.net>

Compaction calls interfaces of mobile page migration
instead of calling balloon migration directly.

Signed-off-by: Gioh Kim <gioh.kim@lge.com>
---
 mm/compaction.c |  8 ++++----
 mm/migrate.c    | 19 ++++++++++---------
 2 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/mm/compaction.c b/mm/compaction.c
index 81bafaf..60e4cbb 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -14,7 +14,7 @@
 #include <linux/backing-dev.h>
 #include <linux/sysctl.h>
 #include <linux/sysfs.h>
-#include <linux/balloon_compaction.h>
+#include <linux/compaction.h>
 #include <linux/page-isolation.h>
 #include <linux/kasan.h>
 #include "internal.h"
@@ -714,12 +714,12 @@ isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn,
 
 		/*
 		 * Check may be lockless but that's ok as we recheck later.
-		 * It's possible to migrate LRU pages and balloon pages
+		 * It's possible to migrate LRU pages and mobile pages
 		 * Skip any other type of page
 		 */
 		if (!PageLRU(page)) {
-			if (unlikely(balloon_page_movable(page))) {
-				if (balloon_page_isolate(page, isolate_mode)) {
+			if (unlikely(mobile_page(page))) {
+				if (isolate_mobilepage(page, isolate_mode)) {
 					/* Successfully isolated */
 					goto isolate_success;
 				}
diff --git a/mm/migrate.c b/mm/migrate.c
index c94038e..e22be67 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -35,7 +35,7 @@
 #include <linux/hugetlb.h>
 #include <linux/hugetlb_cgroup.h>
 #include <linux/gfp.h>
-#include <linux/balloon_compaction.h>
+#include <linux/compaction.h>
 #include <linux/mmu_notifier.h>
 
 #include <asm/tlbflush.h>
@@ -76,7 +76,7 @@ int migrate_prep_local(void)
  * from where they were once taken off for compaction/migration.
  *
  * This function shall be used whenever the isolated pageset has been
- * built from lru, balloon, hugetlbfs page. See isolate_migratepages_range()
+ * built from lru, mobile, hugetlbfs page. See isolate_migratepages_range()
  * and isolate_huge_page().
  */
 void putback_movable_pages(struct list_head *l)
@@ -92,8 +92,8 @@ void putback_movable_pages(struct list_head *l)
 		list_del(&page->lru);
 		dec_zone_page_state(page, NR_ISOLATED_ANON +
 				page_is_file_cache(page));
-		if (unlikely(isolated_balloon_page(page)))
-			balloon_page_putback(page);
+		if (unlikely(mobile_page(page)))
+			putback_mobilepage(page);
 		else
 			putback_lru_page(page);
 	}
@@ -844,15 +844,16 @@ static int __unmap_and_move(struct page *page, struct page *newpage,
 		}
 	}
 
-	if (unlikely(isolated_balloon_page(page))) {
+	if (unlikely(mobile_page(page))) {
 		/*
-		 * A ballooned page does not need any special attention from
+		 * A mobile page does not need any special attention from
 		 * physical to virtual reverse mapping procedures.
 		 * Skip any attempt to unmap PTEs or to remap swap cache,
 		 * in order to avoid burning cycles at rmap level, and perform
 		 * the page migration right away (proteced by page lock).
 		 */
-		rc = balloon_page_migrate(page->mapping, newpage, page, mode);
+		rc = page->mapping->a_ops->migratepage(page->mapping,
+						       newpage, page, mode);
 		goto out_unlock;
 	}
 
@@ -960,8 +961,8 @@ out:
 	if (rc != MIGRATEPAGE_SUCCESS && put_new_page) {
 		ClearPageSwapBacked(newpage);
 		put_new_page(newpage, private);
-	} else if (unlikely(__is_movable_balloon_page(newpage))) {
-		/* drop our reference, page already in the balloon */
+	} else if (unlikely(mobile_page(newpage))) {
+		/* drop our reference */
 		put_page(newpage);
 	} else
 		putback_lru_page(newpage);
-- 
2.1.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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2015-07-07  4:34 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-07  4:36 [RFCv3 0/5] enable migration of driver pages Gioh Kim
2015-07-07  4:36 ` [RFCv3 1/5] fs/anon_inodes: new interface to create new inode Gioh Kim
2015-07-07  4:36 ` [RFCv3 2/5] mm/compaction: enable mobile-page migration Gioh Kim
2015-07-10 13:07   ` Konstantin Khlebnikov
2015-07-13  8:45     ` Gioh Kim
2015-07-10 13:41   ` Konstantin Khlebnikov
2015-07-07  4:36 ` [RFCv3 3/5] mm/balloon: apply mobile page migratable into balloon Gioh Kim
2015-07-09  8:07   ` Michael S. Tsirkin
2015-07-10  0:21     ` Gioh Kim
2015-07-10 13:29   ` Konstantin Khlebnikov
2015-07-07  4:36 ` Gioh Kim [this message]
2015-07-07  4:36 ` [RFCv3 5/5] mm: remove direct calling of migration Gioh Kim
2015-07-07 22:37 ` [RFCv3 0/5] enable migration of driver pages Andrew Morton
2015-07-08  0:02   ` Gioh Kim
2015-07-08  0:07     ` Andrew Morton
2015-07-08  0:19       ` Gioh Kim
2015-07-08  0:35         ` Minchan Kim
2015-07-08 22:47         ` Dave Airlie
2015-07-08 23:55           ` Gioh Kim
2015-07-09 13:08             ` Daniel Vetter
2015-07-09 13:33               ` Ville Syrjälä
2015-07-09 14:02                 ` Kirill A. Shutemov
2015-07-10  0:02               ` Gioh Kim
2015-07-09  1:00 ` Rafael Aquini

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=1436243785-24105-5-git-send-email-gioh.kim@lge.com \
    --to=gioh.kim@lge.com \
    --cc=akpm@linux-foundation.org \
    --cc=aquini@redhat.com \
    --cc=bfields@fieldses.org \
    --cc=gunho.lee@lge.com \
    --cc=gurugio@hanmail.net \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=jlayton@poochiereds.net \
    --cc=koct9i@gmail.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=minchan@kernel.org \
    --cc=mst@redhat.com \
    --cc=vbabka@suse.cz \
    --cc=viro@zeniv.linux.org.uk \
    --cc=virtualization@lists.linux-foundation.org \
    /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