All of lore.kernel.org
 help / color / mirror / Atom feed
diff for duplicates of <20130814163921.GC2706@gmail.com>

diff --git a/a/1.txt b/N1/1.txt
index 1be3673..2ea1118 100644
--- a/a/1.txt
+++ b/N1/1.txt
@@ -85,3 +85,81 @@ I guess.
 3. Higher order page allocation customer always have graceful fallback.
 
 If you really have a concern about that, we can add following.
+
+>From 97d918d6dd9766e6be26512359153400df5c2035 Mon Sep 17 00:00:00 2001
+From: Minchan Kim <minchan@kernel.org>
+Date: Thu, 15 Aug 2013 00:37:21 +0900
+Subject: [PATCH] compaction: skip buddy page during compaction
+
+When isolate_migratepages_range meets free page, it just skip
+a page instead whole free page block. It makes unnecessary
+overhead of compaction so we might want to use page_order to skip whole
+free page block but it's not safe without zone->lock.
+
+With more thinking, it's always not right because CMA and memory-hotplug
+already isolated free pages in the range to MIGRATE_ISOLATE right before
+starting migration so we could use page_order safely in those contexts
+even if we don't hold zone->lock.
+
+In addition to that, it's likely to have many free pages in case of CMA
+because CMA makes MIGRATE_CMA fallback of MIGRATE_MOVABLE to minimize
+number of migrations. Even CMA area was full, it could have many free pages
+once driver who is CMA area's owner releases the CMA area.
+So, the bigger CMA space is, the bigger patch's benefit is.
+And it could help memory-hotplug, too.
+
+Signed-off-by: Minchan Kim <minchan@kernel.org>
+---
+ mm/compaction.c | 12 +++++++++++-
+ 1 file changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/mm/compaction.c b/mm/compaction.c
+index 05ccb4c..aed6c0b 100644
+--- a/mm/compaction.c
++++ b/mm/compaction.c
+@@ -520,8 +520,18 @@ isolate_migratepages_range(struct zone *zone, struct compact_control *cc,
+ 			goto next_pageblock;
+ 
+ 		/* Skip if free */
+-		if (PageBuddy(page))
++		if (PageBuddy(page)) {
++#ifdef CONFIG_MEMORY_ISOLATION
++			/*
++			 * memory-hotplug and CMA already move free pages to
++			 * MIGRATE_ISOLATE so we can use page_order safely
++			 * without zone->lock.
++			 */
++			if (PageBuddy(page))
++				low_pfn += (1 << page_order(page)) - 1;
++#endif
+ 			continue;
++		}
+ 
+ 		/*
+ 		 * For async migration, also only scan in MOVABLE blocks. Async
+-- 
+1.8.3.2
+
+
+
+> from this patch?
+
+I have no data now but if we need it, I will try it with CMA or memory-hotplug
+after return back to the office. Maybe some weeks later.
+
+Thanks for the review, Mel!
+
+> 
+> -- 
+> Mel Gorman
+> SUSE Labs
+> 
+> --
+> 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>
+
+-- 
+Kind regards,
+Minchan Kim
diff --git a/a/content_digest b/N1/content_digest
index 8caac46..65fdfb4 100644
--- a/a/content_digest
+++ b/N1/content_digest
@@ -100,6 +100,84 @@
  "2. Race is really small\n"
  "3. Higher order page allocation customer always have graceful fallback.\n"
  "\n"
- If you really have a concern about that, we can add following.
+ "If you really have a concern about that, we can add following.\n"
+ "\n"
+ ">From 97d918d6dd9766e6be26512359153400df5c2035 Mon Sep 17 00:00:00 2001\n"
+ "From: Minchan Kim <minchan@kernel.org>\n"
+ "Date: Thu, 15 Aug 2013 00:37:21 +0900\n"
+ "Subject: [PATCH] compaction: skip buddy page during compaction\n"
+ "\n"
+ "When isolate_migratepages_range meets free page, it just skip\n"
+ "a page instead whole free page block. It makes unnecessary\n"
+ "overhead of compaction so we might want to use page_order to skip whole\n"
+ "free page block but it's not safe without zone->lock.\n"
+ "\n"
+ "With more thinking, it's always not right because CMA and memory-hotplug\n"
+ "already isolated free pages in the range to MIGRATE_ISOLATE right before\n"
+ "starting migration so we could use page_order safely in those contexts\n"
+ "even if we don't hold zone->lock.\n"
+ "\n"
+ "In addition to that, it's likely to have many free pages in case of CMA\n"
+ "because CMA makes MIGRATE_CMA fallback of MIGRATE_MOVABLE to minimize\n"
+ "number of migrations. Even CMA area was full, it could have many free pages\n"
+ "once driver who is CMA area's owner releases the CMA area.\n"
+ "So, the bigger CMA space is, the bigger patch's benefit is.\n"
+ "And it could help memory-hotplug, too.\n"
+ "\n"
+ "Signed-off-by: Minchan Kim <minchan@kernel.org>\n"
+ "---\n"
+ " mm/compaction.c | 12 +++++++++++-\n"
+ " 1 file changed, 11 insertions(+), 1 deletion(-)\n"
+ "\n"
+ "diff --git a/mm/compaction.c b/mm/compaction.c\n"
+ "index 05ccb4c..aed6c0b 100644\n"
+ "--- a/mm/compaction.c\n"
+ "+++ b/mm/compaction.c\n"
+ "@@ -520,8 +520,18 @@ isolate_migratepages_range(struct zone *zone, struct compact_control *cc,\n"
+ " \t\t\tgoto next_pageblock;\n"
+ " \n"
+ " \t\t/* Skip if free */\n"
+ "-\t\tif (PageBuddy(page))\n"
+ "+\t\tif (PageBuddy(page)) {\n"
+ "+#ifdef CONFIG_MEMORY_ISOLATION\n"
+ "+\t\t\t/*\n"
+ "+\t\t\t * memory-hotplug and CMA already move free pages to\n"
+ "+\t\t\t * MIGRATE_ISOLATE so we can use page_order safely\n"
+ "+\t\t\t * without zone->lock.\n"
+ "+\t\t\t */\n"
+ "+\t\t\tif (PageBuddy(page))\n"
+ "+\t\t\t\tlow_pfn += (1 << page_order(page)) - 1;\n"
+ "+#endif\n"
+ " \t\t\tcontinue;\n"
+ "+\t\t}\n"
+ " \n"
+ " \t\t/*\n"
+ " \t\t * For async migration, also only scan in MOVABLE blocks. Async\n"
+ "-- \n"
+ "1.8.3.2\n"
+ "\n"
+ "\n"
+ "\n"
+ "> from this patch?\n"
+ "\n"
+ "I have no data now but if we need it, I will try it with CMA or memory-hotplug\n"
+ "after return back to the office. Maybe some weeks later.\n"
+ "\n"
+ "Thanks for the review, Mel!\n"
+ "\n"
+ "> \n"
+ "> -- \n"
+ "> Mel Gorman\n"
+ "> SUSE Labs\n"
+ "> \n"
+ "> --\n"
+ "> To unsubscribe, send a message with 'unsubscribe linux-mm' in\n"
+ "> the body to majordomo@kvack.org.  For more info on Linux MM,\n"
+ "> see: http://www.linux-mm.org/ .\n"
+ "> Don't email: <a href=mailto:\"dont@kvack.org\"> email@kvack.org </a>\n"
+ "\n"
+ "-- \n"
+ "Kind regards,\n"
+ Minchan Kim
 
-7e71db357a37715a248d68b3ab3dce7b90e78da632b9dd579c1361a2b1207fc0
+14e5778cd74a651139326ac216c7b2ba341a6cfddedba0853c32dc76f1e5184b

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.