Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1578670 > unrolled thread

[PATCH v2 05/10] mm, compaction: change migrate_async_suitable() to suitable_migration_source()

Started byVlastimil Babka <vbabka@suse.cz>
First post2017-02-10 19:20 +0100
Last post2017-02-14 19:20 +0100
Articles 3 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v2 05/10] mm, compaction: change migrate_async_suitable() to suitable_migration_source() Vlastimil Babka <vbabka@suse.cz> - 2017-02-10 19:20 +0100
    Re: [PATCH v2 05/10] mm, compaction: change migrate_async_suitable()  to suitable_migration_source() Mel Gorman <mgorman@techsingularity.net> - 2017-02-13 12:00 +0100
    Re: [PATCH v2 05/10] mm, compaction: change migrate_async_suitable()  to suitable_migration_source() Johannes Weiner <hannes@cmpxchg.org> - 2017-02-14 19:20 +0100

#1578670 — [PATCH v2 05/10] mm, compaction: change migrate_async_suitable() to suitable_migration_source()

FromVlastimil Babka <vbabka@suse.cz>
Date2017-02-10 19:20 +0100
Subject[PATCH v2 05/10] mm, compaction: change migrate_async_suitable() to suitable_migration_source()
Message-ID<t9nXA-6ZO-11@gated-at.bofh.it>
Preparation for making the decisions more complex and depending on
compact_control flags. No functional change.

Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
---
 include/linux/mmzone.h |  5 +++++
 mm/compaction.c        | 19 +++++++++++--------
 2 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 0f088f3a2fed..fd60a2b2d25d 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -74,6 +74,11 @@ extern char * const migratetype_names[MIGRATE_TYPES];
 #  define is_migrate_cma_page(_page) false
 #endif
 
+static inline bool is_migrate_movable(int mt)
+{
+	return is_migrate_cma(mt) || mt == MIGRATE_MOVABLE;
+}
+
 #define for_each_migratetype_order(order, type) \
 	for (order = 0; order < MAX_ORDER; order++) \
 		for (type = 0; type < MIGRATE_TYPES; type++)
diff --git a/mm/compaction.c b/mm/compaction.c
index fc88e7b6fe37..6c477025c3da 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -88,11 +88,6 @@ static void map_pages(struct list_head *list)
 	list_splice(&tmp_list, list);
 }
 
-static inline bool migrate_async_suitable(int migratetype)
-{
-	return is_migrate_cma(migratetype) || migratetype == MIGRATE_MOVABLE;
-}
-
 #ifdef CONFIG_COMPACTION
 
 int PageMovable(struct page *page)
@@ -996,6 +991,15 @@ isolate_migratepages_range(struct compact_control *cc, unsigned long start_pfn,
 #endif /* CONFIG_COMPACTION || CONFIG_CMA */
 #ifdef CONFIG_COMPACTION
 
+static bool suitable_migration_source(struct compact_control *cc,
+							struct page *page)
+{
+	if (cc->mode != MIGRATE_ASYNC)
+		return true;
+
+	return is_migrate_movable(get_pageblock_migratetype(page));
+}
+
 /* Returns true if the page is within a block suitable for migration to */
 static bool suitable_migration_target(struct compact_control *cc,
 							struct page *page)
@@ -1015,7 +1019,7 @@ static bool suitable_migration_target(struct compact_control *cc,
 	}
 
 	/* If the block is MIGRATE_MOVABLE or MIGRATE_CMA, allow migration */
-	if (migrate_async_suitable(get_pageblock_migratetype(page)))
+	if (is_migrate_movable(get_pageblock_migratetype(page)))
 		return true;
 
 	/* Otherwise skip the block */
@@ -1250,8 +1254,7 @@ static isolate_migrate_t isolate_migratepages(struct zone *zone,
 		 * Async compaction is optimistic to see if the minimum amount
 		 * of work satisfies the allocation.
 		 */
-		if (cc->mode == MIGRATE_ASYNC &&
-		    !migrate_async_suitable(get_pageblock_migratetype(page)))
+		if (!suitable_migration_source(cc, page))
 			continue;
 
 		/* Perform the isolation */
-- 
2.11.0

[toc] | [next] | [standalone]


#1579610 — Re: [PATCH v2 05/10] mm, compaction: change migrate_async_suitable() to suitable_migration_source()

FromMel Gorman <mgorman@techsingularity.net>
Date2017-02-13 12:00 +0100
SubjectRe: [PATCH v2 05/10] mm, compaction: change migrate_async_suitable() to suitable_migration_source()
Message-ID<tamwp-2Cb-5@gated-at.bofh.it>
In reply to#1578670
On Fri, Feb 10, 2017 at 06:23:38PM +0100, Vlastimil Babka wrote:
> Preparation for making the decisions more complex and depending on
> compact_control flags. No functional change.
> 
> Signed-off-by: Vlastimil Babka <vbabka@suse.cz>

Acked-by: Mel Gorman <mgorman@techsingularity.net>

-- 
Mel Gorman
SUSE Labs

[toc] | [prev] | [next] | [standalone]


#1580732 — Re: [PATCH v2 05/10] mm, compaction: change migrate_async_suitable() to suitable_migration_source()

FromJohannes Weiner <hannes@cmpxchg.org>
Date2017-02-14 19:20 +0100
SubjectRe: [PATCH v2 05/10] mm, compaction: change migrate_async_suitable() to suitable_migration_source()
Message-ID<taPRM-5dX-13@gated-at.bofh.it>
In reply to#1578670
On Fri, Feb 10, 2017 at 06:23:38PM +0100, Vlastimil Babka wrote:
> Preparation for making the decisions more complex and depending on
> compact_control flags. No functional change.
> 
> Signed-off-by: Vlastimil Babka <vbabka@suse.cz>

Acked-by: Johannes Weiner <hannes@cmpxchg.org>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web