* [PATCH V2 linux-next] mm,compaction: move suitable_migration_target() under CONFIG_COMPACTION
@ 2015-01-13 18:21 Fabian Frederick
2015-01-14 14:55 ` Vlastimil Babka
0 siblings, 1 reply; 2+ messages in thread
From: Fabian Frederick @ 2015-01-13 18:21 UTC (permalink / raw)
To: linux-kernel; +Cc: Fabian Frederick, linux-mm
suitable_migration_target() is only used by isolate_freepages()
Define it under CONFIG_COMPACTION || CONFIG_CMA is not needed.
Fix the following warning:
mm/compaction.c:311:13: warning: 'suitable_migration_target' defined
but not used [-Wunused-function]
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
v2: move function below update_pageblock_skip() instead of above
isolate_freepages() (suggested by Vlastimil Babka)
mm/compaction.c | 44 ++++++++++++++++++++++----------------------
1 file changed, 22 insertions(+), 22 deletions(-)
diff --git a/mm/compaction.c b/mm/compaction.c
index 546e571..580790d 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -207,6 +207,28 @@ static void update_pageblock_skip(struct compact_control *cc,
zone->compact_cached_free_pfn = pfn;
}
}
+
+/* Returns true if the page is within a block suitable for migration to */
+static bool suitable_migration_target(struct page *page)
+{
+ /* If the page is a large free page, then disallow migration */
+ if (PageBuddy(page)) {
+ /*
+ * We are checking page_order without zone->lock taken. But
+ * the only small danger is that we skip a potentially suitable
+ * pageblock, so it's not worth to check order for valid range.
+ */
+ if (page_order_unsafe(page) >= pageblock_order)
+ return false;
+ }
+
+ /* If the block is MIGRATE_MOVABLE or MIGRATE_CMA, allow migration */
+ if (migrate_async_suitable(get_pageblock_migratetype(page)))
+ return true;
+
+ /* Otherwise skip the block */
+ return false;
+}
#else
static inline bool isolation_suitable(struct compact_control *cc,
struct page *page)
@@ -307,28 +329,6 @@ static inline bool compact_should_abort(struct compact_control *cc)
return false;
}
-/* Returns true if the page is within a block suitable for migration to */
-static bool suitable_migration_target(struct page *page)
-{
- /* If the page is a large free page, then disallow migration */
- if (PageBuddy(page)) {
- /*
- * We are checking page_order without zone->lock taken. But
- * the only small danger is that we skip a potentially suitable
- * pageblock, so it's not worth to check order for valid range.
- */
- if (page_order_unsafe(page) >= pageblock_order)
- return false;
- }
-
- /* If the block is MIGRATE_MOVABLE or MIGRATE_CMA, allow migration */
- if (migrate_async_suitable(get_pageblock_migratetype(page)))
- return true;
-
- /* Otherwise skip the block */
- return false;
-}
-
/*
* Isolate free pages onto a private freelist. If @strict is true, will abort
* returning 0 on any invalid PFNs or non-free pages inside of the pageblock
--
2.1.0
--
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>
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH V2 linux-next] mm,compaction: move suitable_migration_target() under CONFIG_COMPACTION
2015-01-13 18:21 [PATCH V2 linux-next] mm,compaction: move suitable_migration_target() under CONFIG_COMPACTION Fabian Frederick
@ 2015-01-14 14:55 ` Vlastimil Babka
0 siblings, 0 replies; 2+ messages in thread
From: Vlastimil Babka @ 2015-01-14 14:55 UTC (permalink / raw)
To: Fabian Frederick, linux-kernel; +Cc: linux-mm
On 01/13/2015 07:21 PM, Fabian Frederick wrote:
> suitable_migration_target() is only used by isolate_freepages()
> Define it under CONFIG_COMPACTION || CONFIG_CMA is not needed.
>
> Fix the following warning:
> mm/compaction.c:311:13: warning: 'suitable_migration_target' defined
> but not used [-Wunused-function]
>
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Thanks.
> ---
> v2: move function below update_pageblock_skip() instead of above
> isolate_freepages() (suggested by Vlastimil Babka)
>
>
> mm/compaction.c | 44 ++++++++++++++++++++++----------------------
> 1 file changed, 22 insertions(+), 22 deletions(-)
>
> diff --git a/mm/compaction.c b/mm/compaction.c
> index 546e571..580790d 100644
> --- a/mm/compaction.c
> +++ b/mm/compaction.c
> @@ -207,6 +207,28 @@ static void update_pageblock_skip(struct compact_control *cc,
> zone->compact_cached_free_pfn = pfn;
> }
> }
> +
> +/* Returns true if the page is within a block suitable for migration to */
> +static bool suitable_migration_target(struct page *page)
> +{
> + /* If the page is a large free page, then disallow migration */
> + if (PageBuddy(page)) {
> + /*
> + * We are checking page_order without zone->lock taken. But
> + * the only small danger is that we skip a potentially suitable
> + * pageblock, so it's not worth to check order for valid range.
> + */
> + if (page_order_unsafe(page) >= pageblock_order)
> + return false;
> + }
> +
> + /* If the block is MIGRATE_MOVABLE or MIGRATE_CMA, allow migration */
> + if (migrate_async_suitable(get_pageblock_migratetype(page)))
> + return true;
> +
> + /* Otherwise skip the block */
> + return false;
> +}
> #else
> static inline bool isolation_suitable(struct compact_control *cc,
> struct page *page)
> @@ -307,28 +329,6 @@ static inline bool compact_should_abort(struct compact_control *cc)
> return false;
> }
>
> -/* Returns true if the page is within a block suitable for migration to */
> -static bool suitable_migration_target(struct page *page)
> -{
> - /* If the page is a large free page, then disallow migration */
> - if (PageBuddy(page)) {
> - /*
> - * We are checking page_order without zone->lock taken. But
> - * the only small danger is that we skip a potentially suitable
> - * pageblock, so it's not worth to check order for valid range.
> - */
> - if (page_order_unsafe(page) >= pageblock_order)
> - return false;
> - }
> -
> - /* If the block is MIGRATE_MOVABLE or MIGRATE_CMA, allow migration */
> - if (migrate_async_suitable(get_pageblock_migratetype(page)))
> - return true;
> -
> - /* Otherwise skip the block */
> - return false;
> -}
> -
> /*
> * Isolate free pages onto a private freelist. If @strict is true, will abort
> * returning 0 on any invalid PFNs or non-free pages inside of the pageblock
>
--
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>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-01-14 14:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-13 18:21 [PATCH V2 linux-next] mm,compaction: move suitable_migration_target() under CONFIG_COMPACTION Fabian Frederick
2015-01-14 14:55 ` Vlastimil Babka
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox