Re: [PATCH 1/1 linux-next] mm,compaction: move suitable_migration_target() under CONFIG_COMPACTION
On 01/09/2015 10:30 PM, Fabian Frederick wrote: > > >> On 06 January 2015 at 18:21 Vlastimil Babka wrote: >> >> >> On 01/03/2015 05:04 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 >> >> I agree, I would just move it to the section where isolation_suitable() and >> related others are, maybe at the end of this section below >> update_pageblock_skip()? > > Yes of course, that would solve the warning as well. So, send a v2? :) Thanks. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/1 linux-next] mm,compaction: move suitable_migration_target() under CONFIG_COMPACTION
On 01/09/2015 10:30 PM, Fabian Frederick wrote: On 06 January 2015 at 18:21 Vlastimil Babka vba...@suse.cz wrote: On 01/03/2015 05:04 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 f...@skynet.be I agree, I would just move it to the section where isolation_suitable() and related others are, maybe at the end of this section below update_pageblock_skip()? Yes of course, that would solve the warning as well. So, send a v2? :) Thanks. -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/1 linux-next] mm,compaction: move suitable_migration_target() under CONFIG_COMPACTION
> On 06 January 2015 at 18:21 Vlastimil Babka wrote: > > > On 01/03/2015 05:04 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 > > I agree, I would just move it to the section where isolation_suitable() and > related others are, maybe at the end of this section below > update_pageblock_skip()? Yes of course, that would solve the warning as well. Fabian > > Vlastimil > > > --- > > mm/compaction.c | 44 ++-- > > 1 file changed, 22 insertions(+), 22 deletions(-) > > > > diff --git a/mm/compaction.c b/mm/compaction.c > > index 546e571..38b151c 100644 > > --- a/mm/compaction.c > > +++ b/mm/compaction.c > > @@ -307,28 +307,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 > > @@ -802,6 +780,28 @@ isolate_migratepages_range(struct compact_control *cc, > > unsigned long start_pfn, > > > > #endif /* CONFIG_COMPACTION || CONFIG_CMA */ > > #ifdef CONFIG_COMPACTION > > +/* 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; > > +} > > + > > /* > > * Based on information in the current compact_control, find blocks > > * suitable for isolating free pages from and then isolate them. > > > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/1 linux-next] mm,compaction: move suitable_migration_target() under CONFIG_COMPACTION
On 06 January 2015 at 18:21 Vlastimil Babka vba...@suse.cz wrote: On 01/03/2015 05:04 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 f...@skynet.be I agree, I would just move it to the section where isolation_suitable() and related others are, maybe at the end of this section below update_pageblock_skip()? Yes of course, that would solve the warning as well. Fabian Vlastimil --- mm/compaction.c | 44 ++-- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/mm/compaction.c b/mm/compaction.c index 546e571..38b151c 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -307,28 +307,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 @@ -802,6 +780,28 @@ isolate_migratepages_range(struct compact_control *cc, unsigned long start_pfn, #endif /* CONFIG_COMPACTION || CONFIG_CMA */ #ifdef CONFIG_COMPACTION +/* 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; +} + /* * Based on information in the current compact_control, find blocks * suitable for isolating free pages from and then isolate them. -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/1 linux-next] mm,compaction: move suitable_migration_target() under CONFIG_COMPACTION
On 01/03/2015 05:04 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 I agree, I would just move it to the section where isolation_suitable() and related others are, maybe at the end of this section below update_pageblock_skip()? Vlastimil > --- > mm/compaction.c | 44 ++-- > 1 file changed, 22 insertions(+), 22 deletions(-) > > diff --git a/mm/compaction.c b/mm/compaction.c > index 546e571..38b151c 100644 > --- a/mm/compaction.c > +++ b/mm/compaction.c > @@ -307,28 +307,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 > @@ -802,6 +780,28 @@ isolate_migratepages_range(struct compact_control *cc, > unsigned long start_pfn, > > #endif /* CONFIG_COMPACTION || CONFIG_CMA */ > #ifdef CONFIG_COMPACTION > +/* 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; > +} > + > /* > * Based on information in the current compact_control, find blocks > * suitable for isolating free pages from and then isolate them. > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/1 linux-next] mm,compaction: move suitable_migration_target() under CONFIG_COMPACTION
On 01/03/2015 05:04 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 f...@skynet.be I agree, I would just move it to the section where isolation_suitable() and related others are, maybe at the end of this section below update_pageblock_skip()? Vlastimil --- mm/compaction.c | 44 ++-- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/mm/compaction.c b/mm/compaction.c index 546e571..38b151c 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -307,28 +307,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 @@ -802,6 +780,28 @@ isolate_migratepages_range(struct compact_control *cc, unsigned long start_pfn, #endif /* CONFIG_COMPACTION || CONFIG_CMA */ #ifdef CONFIG_COMPACTION +/* 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; +} + /* * Based on information in the current compact_control, find blocks * suitable for isolating free pages from and then isolate them. -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 1/1 linux-next] mm,compaction: move suitable_migration_target() under CONFIG_COMPACTION
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 --- mm/compaction.c | 44 ++-- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/mm/compaction.c b/mm/compaction.c index 546e571..38b151c 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -307,28 +307,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 @@ -802,6 +780,28 @@ isolate_migratepages_range(struct compact_control *cc, unsigned long start_pfn, #endif /* CONFIG_COMPACTION || CONFIG_CMA */ #ifdef CONFIG_COMPACTION +/* 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; +} + /* * Based on information in the current compact_control, find blocks * suitable for isolating free pages from and then isolate them. -- 2.1.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 1/1 linux-next] mm,compaction: move suitable_migration_target() under CONFIG_COMPACTION
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 f...@skynet.be --- mm/compaction.c | 44 ++-- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/mm/compaction.c b/mm/compaction.c index 546e571..38b151c 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -307,28 +307,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 @@ -802,6 +780,28 @@ isolate_migratepages_range(struct compact_control *cc, unsigned long start_pfn, #endif /* CONFIG_COMPACTION || CONFIG_CMA */ #ifdef CONFIG_COMPACTION +/* 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; +} + /* * Based on information in the current compact_control, find blocks * suitable for isolating free pages from and then isolate them. -- 2.1.0 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/