All of lore.kernel.org
 help / color / mirror / Atom feed
diff for duplicates of <20111116041350.GA3306@redhat.com>

diff --git a/a/1.txt b/N1/1.txt
index 92d3c00..1b13b9a 100644
--- a/a/1.txt
+++ b/N1/1.txt
@@ -67,321 +67,3 @@ pages and isolating only clean pages like it would have done with
 async forced.
 
 ===
->From 3a379b180aa544f876d3c42b47ae20060ae6279b Mon Sep 17 00:00:00 2001
-From: Andrea Arcangeli <aarcange@redhat.com>
-Date: Wed, 16 Nov 2011 02:52:36 +0100
-Subject: [PATCH] compaction: avoid overwork in migrate sync mode
-
-Add a migration sync=2 mode that avoids overwork so more suitable to
-be used by compaction to provide lower latency but still write
-throttling.
-
-Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
----
- include/linux/migrate.h |    8 ++--
- mm/compaction.c         |    2 +-
- mm/memory-failure.c     |    2 +-
- mm/memory_hotplug.c     |    2 +-
- mm/mempolicy.c          |    4 +-
- mm/migrate.c            |   77 ++++++++++++++++++++++++++++++-----------------
- 6 files changed, 58 insertions(+), 37 deletions(-)
-
-diff --git a/include/linux/migrate.h b/include/linux/migrate.h
-index e39aeec..f26fc0e 100644
---- a/include/linux/migrate.h
-+++ b/include/linux/migrate.h
-@@ -14,10 +14,10 @@ extern int migrate_page(struct address_space *,
- 			struct page *, struct page *);
- extern int migrate_pages(struct list_head *l, new_page_t x,
- 			unsigned long private, bool offlining,
--			bool sync);
-+			int sync);
- extern int migrate_huge_pages(struct list_head *l, new_page_t x,
- 			unsigned long private, bool offlining,
--			bool sync);
-+			int sync);
- 
- extern int fail_migrate_page(struct address_space *,
- 			struct page *, struct page *);
-@@ -36,10 +36,10 @@ extern int migrate_huge_page_move_mapping(struct address_space *mapping,
- static inline void putback_lru_pages(struct list_head *l) {}
- static inline int migrate_pages(struct list_head *l, new_page_t x,
- 		unsigned long private, bool offlining,
--		bool sync) { return -ENOSYS; }
-+		int sync) { return -ENOSYS; }
- static inline int migrate_huge_pages(struct list_head *l, new_page_t x,
- 		unsigned long private, bool offlining,
--		bool sync) { return -ENOSYS; }
-+		int sync) { return -ENOSYS; }
- 
- static inline int migrate_prep(void) { return -ENOSYS; }
- static inline int migrate_prep_local(void) { return -ENOSYS; }
-diff --git a/mm/compaction.c b/mm/compaction.c
-index be0be1d..cbf2784 100644
---- a/mm/compaction.c
-+++ b/mm/compaction.c
-@@ -555,7 +555,7 @@ static int compact_zone(struct zone *zone, struct compact_control *cc)
- 		nr_migrate = cc->nr_migratepages;
- 		err = migrate_pages(&cc->migratepages, compaction_alloc,
- 				(unsigned long)cc, false,
--				cc->sync);
-+				cc->sync ? 2 : 0);
- 		update_nr_listpages(cc);
- 		nr_remaining = cc->nr_migratepages;
- 
-diff --git a/mm/memory-failure.c b/mm/memory-failure.c
-index 06d3479..d8a41d3 100644
---- a/mm/memory-failure.c
-+++ b/mm/memory-failure.c
-@@ -1557,7 +1557,7 @@ int soft_offline_page(struct page *page, int flags)
- 					    page_is_file_cache(page));
- 		list_add(&page->lru, &pagelist);
- 		ret = migrate_pages(&pagelist, new_page, MPOL_MF_MOVE_ALL,
--								0, true);
-+				    false, 1);
- 		if (ret) {
- 			putback_lru_pages(&pagelist);
- 			pr_info("soft offline: %#lx: migration failed %d, type %lx\n",
-diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
-index 2168489..e1d6176 100644
---- a/mm/memory_hotplug.c
-+++ b/mm/memory_hotplug.c
-@@ -809,7 +809,7 @@ do_migrate_range(unsigned long start_pfn, unsigned long end_pfn)
- 		}
- 		/* this function returns # of failed pages */
- 		ret = migrate_pages(&source, hotremove_migrate_alloc, 0,
--								true, true);
-+				    true, 1);
- 		if (ret)
- 			putback_lru_pages(&source);
- 	}
-diff --git a/mm/mempolicy.c b/mm/mempolicy.c
-index adc3954..0bf88ed 100644
---- a/mm/mempolicy.c
-+++ b/mm/mempolicy.c
-@@ -933,7 +933,7 @@ static int migrate_to_node(struct mm_struct *mm, int source, int dest,
- 
- 	if (!list_empty(&pagelist)) {
- 		err = migrate_pages(&pagelist, new_node_page, dest,
--								false, true);
-+				    false, 1);
- 		if (err)
- 			putback_lru_pages(&pagelist);
- 	}
-@@ -1154,7 +1154,7 @@ static long do_mbind(unsigned long start, unsigned long len,
- 		if (!list_empty(&pagelist)) {
- 			nr_failed = migrate_pages(&pagelist, new_vma_page,
- 						(unsigned long)vma,
--						false, true);
-+						false, 1);
- 			if (nr_failed)
- 				putback_lru_pages(&pagelist);
- 		}
-diff --git a/mm/migrate.c b/mm/migrate.c
-index 578e291..175c3bc 100644
---- a/mm/migrate.c
-+++ b/mm/migrate.c
-@@ -564,7 +564,7 @@ static int fallback_migrate_page(struct address_space *mapping,
-  *  == 0 - success
-  */
- static int move_to_new_page(struct page *newpage, struct page *page,
--					int remap_swapcache, bool sync)
-+			    int remap_swapcache, bool force)
- {
- 	struct address_space *mapping;
- 	int rc;
-@@ -588,11 +588,11 @@ static int move_to_new_page(struct page *newpage, struct page *page,
- 		rc = migrate_page(mapping, newpage, page);
- 	else {
- 		/*
--		 * Do not writeback pages if !sync and migratepage is
-+		 * Do not writeback pages if !force and migratepage is
- 		 * not pointing to migrate_page() which is nonblocking
- 		 * (swapcache/tmpfs uses migratepage = migrate_page).
- 		 */
--		if (PageDirty(page) && !sync &&
-+		if (PageDirty(page) && !force &&
- 		    mapping->a_ops->migratepage != migrate_page)
- 			rc = -EBUSY;
- 		else if (mapping->a_ops->migratepage)
-@@ -622,7 +622,7 @@ static int move_to_new_page(struct page *newpage, struct page *page,
- }
- 
- static int __unmap_and_move(struct page *page, struct page *newpage,
--				int force, bool offlining, bool sync)
-+			    bool force, bool offlining)
- {
- 	int rc = -EAGAIN;
- 	int remap_swapcache = 1;
-@@ -631,7 +631,7 @@ static int __unmap_and_move(struct page *page, struct page *newpage,
- 	struct anon_vma *anon_vma = NULL;
- 
- 	if (!trylock_page(page)) {
--		if (!force || !sync)
-+		if (!force)
- 			goto out;
- 
- 		/*
-@@ -676,14 +676,6 @@ static int __unmap_and_move(struct page *page, struct page *newpage,
- 	BUG_ON(charge);
- 
- 	if (PageWriteback(page)) {
--		/*
--		 * For !sync, there is no point retrying as the retry loop
--		 * is expected to be too short for PageWriteback to be cleared
--		 */
--		if (!sync) {
--			rc = -EBUSY;
--			goto uncharge;
--		}
- 		if (!force)
- 			goto uncharge;
- 		wait_on_page_writeback(page);
-@@ -751,7 +743,7 @@ static int __unmap_and_move(struct page *page, struct page *newpage,
- 
- skip_unmap:
- 	if (!page_mapped(page))
--		rc = move_to_new_page(newpage, page, remap_swapcache, sync);
-+		rc = move_to_new_page(newpage, page, remap_swapcache, force);
- 
- 	if (rc && remap_swapcache)
- 		remove_migration_ptes(page, page);
-@@ -774,7 +766,7 @@ out:
-  * to the newly allocated page in newpage.
-  */
- static int unmap_and_move(new_page_t get_new_page, unsigned long private,
--			struct page *page, int force, bool offlining, bool sync)
-+			  struct page *page, bool force, bool offlining)
- {
- 	int rc = 0;
- 	int *result = NULL;
-@@ -792,7 +784,7 @@ static int unmap_and_move(new_page_t get_new_page, unsigned long private,
- 		if (unlikely(split_huge_page(page)))
- 			goto out;
- 
--	rc = __unmap_and_move(page, newpage, force, offlining, sync);
-+	rc = __unmap_and_move(page, newpage, force, offlining);
- out:
- 	if (rc != -EAGAIN) {
- 		/*
-@@ -840,7 +832,7 @@ out:
-  */
- static int unmap_and_move_huge_page(new_page_t get_new_page,
- 				unsigned long private, struct page *hpage,
--				int force, bool offlining, bool sync)
-+				bool force, bool offlining)
- {
- 	int rc = 0;
- 	int *result = NULL;
-@@ -853,7 +845,7 @@ static int unmap_and_move_huge_page(new_page_t get_new_page,
- 	rc = -EAGAIN;
- 
- 	if (!trylock_page(hpage)) {
--		if (!force || !sync)
-+		if (!force)
- 			goto out;
- 		lock_page(hpage);
- 	}
-@@ -864,7 +856,7 @@ static int unmap_and_move_huge_page(new_page_t get_new_page,
- 	try_to_unmap(hpage, TTU_MIGRATION|TTU_IGNORE_MLOCK|TTU_IGNORE_ACCESS);
- 
- 	if (!page_mapped(hpage))
--		rc = move_to_new_page(new_hpage, hpage, 1, sync);
-+		rc = move_to_new_page(new_hpage, hpage, 1, force);
- 
- 	if (rc)
- 		remove_migration_ptes(hpage, hpage);
-@@ -907,7 +899,7 @@ out:
-  */
- int migrate_pages(struct list_head *from,
- 		new_page_t get_new_page, unsigned long private, bool offlining,
--		bool sync)
-+		int sync)
- {
- 	int retry = 1;
- 	int nr_failed = 0;
-@@ -920,15 +912,30 @@ int migrate_pages(struct list_head *from,
- 	if (!swapwrite)
- 		current->flags |= PF_SWAPWRITE;
- 
--	for(pass = 0; pass < 10 && retry; pass++) {
-+	for(pass = 0; pass < (sync == 1 ? 10 : 2) && retry; pass++) {
- 		retry = 0;
- 
- 		list_for_each_entry_safe(page, page2, from, lru) {
-+			bool force;
-+
- 			cond_resched();
- 
-+			switch (sync) {
-+			case 0:
-+				force = false;
-+				break;
-+			case 1:
-+				force = pass > 2;
-+				break;
-+			case 2:
-+				force = pass > 0;
-+				break;
-+			default:
-+				BUG();
-+			}
- 			rc = unmap_and_move(get_new_page, private,
--						page, pass > 2, offlining,
--						sync);
-+					    page,
-+					    force, offlining);
- 
- 			switch(rc) {
- 			case -ENOMEM:
-@@ -958,7 +965,7 @@ out:
- 
- int migrate_huge_pages(struct list_head *from,
- 		new_page_t get_new_page, unsigned long private, bool offlining,
--		bool sync)
-+		int sync)
- {
- 	int retry = 1;
- 	int nr_failed = 0;
-@@ -967,15 +974,29 @@ int migrate_huge_pages(struct list_head *from,
- 	struct page *page2;
- 	int rc;
- 
--	for (pass = 0; pass < 10 && retry; pass++) {
-+	for (pass = 0; pass < (sync == 1 ? 10 : 2) && retry; pass++) {
- 		retry = 0;
- 
- 		list_for_each_entry_safe(page, page2, from, lru) {
-+			bool force;
- 			cond_resched();
- 
-+			switch (sync) {
-+			case 0:
-+				force = false;
-+				break;
-+			case 1:
-+				force = pass > 2;
-+				break;
-+			case 2:
-+				force = pass > 0;
-+				break;
-+			default:
-+				BUG();
-+			}
- 			rc = unmap_and_move_huge_page(get_new_page,
--					private, page, pass > 2, offlining,
--					sync);
-+					private, page,
-+					force, offlining);
- 
- 			switch(rc) {
- 			case -ENOMEM:
-@@ -1104,7 +1125,7 @@ set_status:
- 	err = 0;
- 	if (!list_empty(&pagelist)) {
- 		err = migrate_pages(&pagelist, new_page_node,
--				(unsigned long)pm, 0, true);
-+				    (unsigned long)pm, false, 1);
- 		if (err)
- 			putback_lru_pages(&pagelist);
- 	}
diff --git a/a/content_digest b/N1/content_digest
index e21f4a6..fc80643 100644
--- a/a/content_digest
+++ b/N1/content_digest
@@ -90,324 +90,6 @@
  "pages and isolating only clean pages like it would have done with\n"
  "async forced.\n"
  "\n"
- "===\n"
- ">From 3a379b180aa544f876d3c42b47ae20060ae6279b Mon Sep 17 00:00:00 2001\n"
- "From: Andrea Arcangeli <aarcange@redhat.com>\n"
- "Date: Wed, 16 Nov 2011 02:52:36 +0100\n"
- "Subject: [PATCH] compaction: avoid overwork in migrate sync mode\n"
- "\n"
- "Add a migration sync=2 mode that avoids overwork so more suitable to\n"
- "be used by compaction to provide lower latency but still write\n"
- "throttling.\n"
- "\n"
- "Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>\n"
- "---\n"
- " include/linux/migrate.h |    8 ++--\n"
- " mm/compaction.c         |    2 +-\n"
- " mm/memory-failure.c     |    2 +-\n"
- " mm/memory_hotplug.c     |    2 +-\n"
- " mm/mempolicy.c          |    4 +-\n"
- " mm/migrate.c            |   77 ++++++++++++++++++++++++++++++-----------------\n"
- " 6 files changed, 58 insertions(+), 37 deletions(-)\n"
- "\n"
- "diff --git a/include/linux/migrate.h b/include/linux/migrate.h\n"
- "index e39aeec..f26fc0e 100644\n"
- "--- a/include/linux/migrate.h\n"
- "+++ b/include/linux/migrate.h\n"
- "@@ -14,10 +14,10 @@ extern int migrate_page(struct address_space *,\n"
- " \t\t\tstruct page *, struct page *);\n"
- " extern int migrate_pages(struct list_head *l, new_page_t x,\n"
- " \t\t\tunsigned long private, bool offlining,\n"
- "-\t\t\tbool sync);\n"
- "+\t\t\tint sync);\n"
- " extern int migrate_huge_pages(struct list_head *l, new_page_t x,\n"
- " \t\t\tunsigned long private, bool offlining,\n"
- "-\t\t\tbool sync);\n"
- "+\t\t\tint sync);\n"
- " \n"
- " extern int fail_migrate_page(struct address_space *,\n"
- " \t\t\tstruct page *, struct page *);\n"
- "@@ -36,10 +36,10 @@ extern int migrate_huge_page_move_mapping(struct address_space *mapping,\n"
- " static inline void putback_lru_pages(struct list_head *l) {}\n"
- " static inline int migrate_pages(struct list_head *l, new_page_t x,\n"
- " \t\tunsigned long private, bool offlining,\n"
- "-\t\tbool sync) { return -ENOSYS; }\n"
- "+\t\tint sync) { return -ENOSYS; }\n"
- " static inline int migrate_huge_pages(struct list_head *l, new_page_t x,\n"
- " \t\tunsigned long private, bool offlining,\n"
- "-\t\tbool sync) { return -ENOSYS; }\n"
- "+\t\tint sync) { return -ENOSYS; }\n"
- " \n"
- " static inline int migrate_prep(void) { return -ENOSYS; }\n"
- " static inline int migrate_prep_local(void) { return -ENOSYS; }\n"
- "diff --git a/mm/compaction.c b/mm/compaction.c\n"
- "index be0be1d..cbf2784 100644\n"
- "--- a/mm/compaction.c\n"
- "+++ b/mm/compaction.c\n"
- "@@ -555,7 +555,7 @@ static int compact_zone(struct zone *zone, struct compact_control *cc)\n"
- " \t\tnr_migrate = cc->nr_migratepages;\n"
- " \t\terr = migrate_pages(&cc->migratepages, compaction_alloc,\n"
- " \t\t\t\t(unsigned long)cc, false,\n"
- "-\t\t\t\tcc->sync);\n"
- "+\t\t\t\tcc->sync ? 2 : 0);\n"
- " \t\tupdate_nr_listpages(cc);\n"
- " \t\tnr_remaining = cc->nr_migratepages;\n"
- " \n"
- "diff --git a/mm/memory-failure.c b/mm/memory-failure.c\n"
- "index 06d3479..d8a41d3 100644\n"
- "--- a/mm/memory-failure.c\n"
- "+++ b/mm/memory-failure.c\n"
- "@@ -1557,7 +1557,7 @@ int soft_offline_page(struct page *page, int flags)\n"
- " \t\t\t\t\t    page_is_file_cache(page));\n"
- " \t\tlist_add(&page->lru, &pagelist);\n"
- " \t\tret = migrate_pages(&pagelist, new_page, MPOL_MF_MOVE_ALL,\n"
- "-\t\t\t\t\t\t\t\t0, true);\n"
- "+\t\t\t\t    false, 1);\n"
- " \t\tif (ret) {\n"
- " \t\t\tputback_lru_pages(&pagelist);\n"
- " \t\t\tpr_info(\"soft offline: %#lx: migration failed %d, type %lx\\n\",\n"
- "diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c\n"
- "index 2168489..e1d6176 100644\n"
- "--- a/mm/memory_hotplug.c\n"
- "+++ b/mm/memory_hotplug.c\n"
- "@@ -809,7 +809,7 @@ do_migrate_range(unsigned long start_pfn, unsigned long end_pfn)\n"
- " \t\t}\n"
- " \t\t/* this function returns # of failed pages */\n"
- " \t\tret = migrate_pages(&source, hotremove_migrate_alloc, 0,\n"
- "-\t\t\t\t\t\t\t\ttrue, true);\n"
- "+\t\t\t\t    true, 1);\n"
- " \t\tif (ret)\n"
- " \t\t\tputback_lru_pages(&source);\n"
- " \t}\n"
- "diff --git a/mm/mempolicy.c b/mm/mempolicy.c\n"
- "index adc3954..0bf88ed 100644\n"
- "--- a/mm/mempolicy.c\n"
- "+++ b/mm/mempolicy.c\n"
- "@@ -933,7 +933,7 @@ static int migrate_to_node(struct mm_struct *mm, int source, int dest,\n"
- " \n"
- " \tif (!list_empty(&pagelist)) {\n"
- " \t\terr = migrate_pages(&pagelist, new_node_page, dest,\n"
- "-\t\t\t\t\t\t\t\tfalse, true);\n"
- "+\t\t\t\t    false, 1);\n"
- " \t\tif (err)\n"
- " \t\t\tputback_lru_pages(&pagelist);\n"
- " \t}\n"
- "@@ -1154,7 +1154,7 @@ static long do_mbind(unsigned long start, unsigned long len,\n"
- " \t\tif (!list_empty(&pagelist)) {\n"
- " \t\t\tnr_failed = migrate_pages(&pagelist, new_vma_page,\n"
- " \t\t\t\t\t\t(unsigned long)vma,\n"
- "-\t\t\t\t\t\tfalse, true);\n"
- "+\t\t\t\t\t\tfalse, 1);\n"
- " \t\t\tif (nr_failed)\n"
- " \t\t\t\tputback_lru_pages(&pagelist);\n"
- " \t\t}\n"
- "diff --git a/mm/migrate.c b/mm/migrate.c\n"
- "index 578e291..175c3bc 100644\n"
- "--- a/mm/migrate.c\n"
- "+++ b/mm/migrate.c\n"
- "@@ -564,7 +564,7 @@ static int fallback_migrate_page(struct address_space *mapping,\n"
- "  *  == 0 - success\n"
- "  */\n"
- " static int move_to_new_page(struct page *newpage, struct page *page,\n"
- "-\t\t\t\t\tint remap_swapcache, bool sync)\n"
- "+\t\t\t    int remap_swapcache, bool force)\n"
- " {\n"
- " \tstruct address_space *mapping;\n"
- " \tint rc;\n"
- "@@ -588,11 +588,11 @@ static int move_to_new_page(struct page *newpage, struct page *page,\n"
- " \t\trc = migrate_page(mapping, newpage, page);\n"
- " \telse {\n"
- " \t\t/*\n"
- "-\t\t * Do not writeback pages if !sync and migratepage is\n"
- "+\t\t * Do not writeback pages if !force and migratepage is\n"
- " \t\t * not pointing to migrate_page() which is nonblocking\n"
- " \t\t * (swapcache/tmpfs uses migratepage = migrate_page).\n"
- " \t\t */\n"
- "-\t\tif (PageDirty(page) && !sync &&\n"
- "+\t\tif (PageDirty(page) && !force &&\n"
- " \t\t    mapping->a_ops->migratepage != migrate_page)\n"
- " \t\t\trc = -EBUSY;\n"
- " \t\telse if (mapping->a_ops->migratepage)\n"
- "@@ -622,7 +622,7 @@ static int move_to_new_page(struct page *newpage, struct page *page,\n"
- " }\n"
- " \n"
- " static int __unmap_and_move(struct page *page, struct page *newpage,\n"
- "-\t\t\t\tint force, bool offlining, bool sync)\n"
- "+\t\t\t    bool force, bool offlining)\n"
- " {\n"
- " \tint rc = -EAGAIN;\n"
- " \tint remap_swapcache = 1;\n"
- "@@ -631,7 +631,7 @@ static int __unmap_and_move(struct page *page, struct page *newpage,\n"
- " \tstruct anon_vma *anon_vma = NULL;\n"
- " \n"
- " \tif (!trylock_page(page)) {\n"
- "-\t\tif (!force || !sync)\n"
- "+\t\tif (!force)\n"
- " \t\t\tgoto out;\n"
- " \n"
- " \t\t/*\n"
- "@@ -676,14 +676,6 @@ static int __unmap_and_move(struct page *page, struct page *newpage,\n"
- " \tBUG_ON(charge);\n"
- " \n"
- " \tif (PageWriteback(page)) {\n"
- "-\t\t/*\n"
- "-\t\t * For !sync, there is no point retrying as the retry loop\n"
- "-\t\t * is expected to be too short for PageWriteback to be cleared\n"
- "-\t\t */\n"
- "-\t\tif (!sync) {\n"
- "-\t\t\trc = -EBUSY;\n"
- "-\t\t\tgoto uncharge;\n"
- "-\t\t}\n"
- " \t\tif (!force)\n"
- " \t\t\tgoto uncharge;\n"
- " \t\twait_on_page_writeback(page);\n"
- "@@ -751,7 +743,7 @@ static int __unmap_and_move(struct page *page, struct page *newpage,\n"
- " \n"
- " skip_unmap:\n"
- " \tif (!page_mapped(page))\n"
- "-\t\trc = move_to_new_page(newpage, page, remap_swapcache, sync);\n"
- "+\t\trc = move_to_new_page(newpage, page, remap_swapcache, force);\n"
- " \n"
- " \tif (rc && remap_swapcache)\n"
- " \t\tremove_migration_ptes(page, page);\n"
- "@@ -774,7 +766,7 @@ out:\n"
- "  * to the newly allocated page in newpage.\n"
- "  */\n"
- " static int unmap_and_move(new_page_t get_new_page, unsigned long private,\n"
- "-\t\t\tstruct page *page, int force, bool offlining, bool sync)\n"
- "+\t\t\t  struct page *page, bool force, bool offlining)\n"
- " {\n"
- " \tint rc = 0;\n"
- " \tint *result = NULL;\n"
- "@@ -792,7 +784,7 @@ static int unmap_and_move(new_page_t get_new_page, unsigned long private,\n"
- " \t\tif (unlikely(split_huge_page(page)))\n"
- " \t\t\tgoto out;\n"
- " \n"
- "-\trc = __unmap_and_move(page, newpage, force, offlining, sync);\n"
- "+\trc = __unmap_and_move(page, newpage, force, offlining);\n"
- " out:\n"
- " \tif (rc != -EAGAIN) {\n"
- " \t\t/*\n"
- "@@ -840,7 +832,7 @@ out:\n"
- "  */\n"
- " static int unmap_and_move_huge_page(new_page_t get_new_page,\n"
- " \t\t\t\tunsigned long private, struct page *hpage,\n"
- "-\t\t\t\tint force, bool offlining, bool sync)\n"
- "+\t\t\t\tbool force, bool offlining)\n"
- " {\n"
- " \tint rc = 0;\n"
- " \tint *result = NULL;\n"
- "@@ -853,7 +845,7 @@ static int unmap_and_move_huge_page(new_page_t get_new_page,\n"
- " \trc = -EAGAIN;\n"
- " \n"
- " \tif (!trylock_page(hpage)) {\n"
- "-\t\tif (!force || !sync)\n"
- "+\t\tif (!force)\n"
- " \t\t\tgoto out;\n"
- " \t\tlock_page(hpage);\n"
- " \t}\n"
- "@@ -864,7 +856,7 @@ static int unmap_and_move_huge_page(new_page_t get_new_page,\n"
- " \ttry_to_unmap(hpage, TTU_MIGRATION|TTU_IGNORE_MLOCK|TTU_IGNORE_ACCESS);\n"
- " \n"
- " \tif (!page_mapped(hpage))\n"
- "-\t\trc = move_to_new_page(new_hpage, hpage, 1, sync);\n"
- "+\t\trc = move_to_new_page(new_hpage, hpage, 1, force);\n"
- " \n"
- " \tif (rc)\n"
- " \t\tremove_migration_ptes(hpage, hpage);\n"
- "@@ -907,7 +899,7 @@ out:\n"
- "  */\n"
- " int migrate_pages(struct list_head *from,\n"
- " \t\tnew_page_t get_new_page, unsigned long private, bool offlining,\n"
- "-\t\tbool sync)\n"
- "+\t\tint sync)\n"
- " {\n"
- " \tint retry = 1;\n"
- " \tint nr_failed = 0;\n"
- "@@ -920,15 +912,30 @@ int migrate_pages(struct list_head *from,\n"
- " \tif (!swapwrite)\n"
- " \t\tcurrent->flags |= PF_SWAPWRITE;\n"
- " \n"
- "-\tfor(pass = 0; pass < 10 && retry; pass++) {\n"
- "+\tfor(pass = 0; pass < (sync == 1 ? 10 : 2) && retry; pass++) {\n"
- " \t\tretry = 0;\n"
- " \n"
- " \t\tlist_for_each_entry_safe(page, page2, from, lru) {\n"
- "+\t\t\tbool force;\n"
- "+\n"
- " \t\t\tcond_resched();\n"
- " \n"
- "+\t\t\tswitch (sync) {\n"
- "+\t\t\tcase 0:\n"
- "+\t\t\t\tforce = false;\n"
- "+\t\t\t\tbreak;\n"
- "+\t\t\tcase 1:\n"
- "+\t\t\t\tforce = pass > 2;\n"
- "+\t\t\t\tbreak;\n"
- "+\t\t\tcase 2:\n"
- "+\t\t\t\tforce = pass > 0;\n"
- "+\t\t\t\tbreak;\n"
- "+\t\t\tdefault:\n"
- "+\t\t\t\tBUG();\n"
- "+\t\t\t}\n"
- " \t\t\trc = unmap_and_move(get_new_page, private,\n"
- "-\t\t\t\t\t\tpage, pass > 2, offlining,\n"
- "-\t\t\t\t\t\tsync);\n"
- "+\t\t\t\t\t    page,\n"
- "+\t\t\t\t\t    force, offlining);\n"
- " \n"
- " \t\t\tswitch(rc) {\n"
- " \t\t\tcase -ENOMEM:\n"
- "@@ -958,7 +965,7 @@ out:\n"
- " \n"
- " int migrate_huge_pages(struct list_head *from,\n"
- " \t\tnew_page_t get_new_page, unsigned long private, bool offlining,\n"
- "-\t\tbool sync)\n"
- "+\t\tint sync)\n"
- " {\n"
- " \tint retry = 1;\n"
- " \tint nr_failed = 0;\n"
- "@@ -967,15 +974,29 @@ int migrate_huge_pages(struct list_head *from,\n"
- " \tstruct page *page2;\n"
- " \tint rc;\n"
- " \n"
- "-\tfor (pass = 0; pass < 10 && retry; pass++) {\n"
- "+\tfor (pass = 0; pass < (sync == 1 ? 10 : 2) && retry; pass++) {\n"
- " \t\tretry = 0;\n"
- " \n"
- " \t\tlist_for_each_entry_safe(page, page2, from, lru) {\n"
- "+\t\t\tbool force;\n"
- " \t\t\tcond_resched();\n"
- " \n"
- "+\t\t\tswitch (sync) {\n"
- "+\t\t\tcase 0:\n"
- "+\t\t\t\tforce = false;\n"
- "+\t\t\t\tbreak;\n"
- "+\t\t\tcase 1:\n"
- "+\t\t\t\tforce = pass > 2;\n"
- "+\t\t\t\tbreak;\n"
- "+\t\t\tcase 2:\n"
- "+\t\t\t\tforce = pass > 0;\n"
- "+\t\t\t\tbreak;\n"
- "+\t\t\tdefault:\n"
- "+\t\t\t\tBUG();\n"
- "+\t\t\t}\n"
- " \t\t\trc = unmap_and_move_huge_page(get_new_page,\n"
- "-\t\t\t\t\tprivate, page, pass > 2, offlining,\n"
- "-\t\t\t\t\tsync);\n"
- "+\t\t\t\t\tprivate, page,\n"
- "+\t\t\t\t\tforce, offlining);\n"
- " \n"
- " \t\t\tswitch(rc) {\n"
- " \t\t\tcase -ENOMEM:\n"
- "@@ -1104,7 +1125,7 @@ set_status:\n"
- " \terr = 0;\n"
- " \tif (!list_empty(&pagelist)) {\n"
- " \t\terr = migrate_pages(&pagelist, new_page_node,\n"
- "-\t\t\t\t(unsigned long)pm, 0, true);\n"
- "+\t\t\t\t    (unsigned long)pm, false, 1);\n"
- " \t\tif (err)\n"
- " \t\t\tputback_lru_pages(&pagelist);\n"
- " \t}"
+ ===
 
-d2956deb543d8efc9d2e482dfdc619f3c77237919ba13fc404df58881de7727b
+9cbd0b231fd1111472d28a61ef7ca7b438d88de4b05786fd0cfad4d032dd064a

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.