All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vlastimil Babka <vbabka@suse.cz>
To: Andrew Morton <akpm@linux-foundation.org>,
	kbuild test robot <fengguang.wu@intel.com>
Cc: kbuild-all@01.org,
	Linux Memory Management List <linux-mm@kvack.org>,
	Fabian Frederick <fabf@skynet.be>
Subject: Re: mm/compaction.c:250:13: warning: 'suitable_migration_target' defined but not used
Date: Tue, 14 Apr 2015 22:00:06 +0200	[thread overview]
Message-ID: <552D71C6.1020503@suse.cz> (raw)
In-Reply-To: <20150414125449.f97ea3286a90a55531d25924@linux-foundation.org>

On 14.4.2015 21:54, Andrew Morton wrote:
> On Tue, 14 Apr 2015 14:53:45 +0800 kbuild test robot <fengguang.wu@intel.com> wrote:
> 
>> tree:   git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
>> head:   b79013b2449c23f1f505bdf39c5a6c330338b244
>> commit: f8224aa5a0a4627926019bba7511926393fbee3b mm, compaction: do not recheck suitable_migration_target under lock
>> date:   6 months ago
>> config: x86_64-randconfig-ib0-04141359 (attached as .config)
>> reproduce:
>>   git checkout f8224aa5a0a4627926019bba7511926393fbee3b
>>   # save the attached .config to linux build tree
>>   make ARCH=x86_64 
>>
>> All warnings:
>>
>>>> mm/compaction.c:250:13: warning: 'suitable_migration_target' defined but not used [-Wunused-function]
>>     static bool suitable_migration_target(struct page *page)
>>                 ^
> 
> Easy enough - it only has one callsite.

This sounded familiar, and sure enough I found patch from January
https://lkml.org/lkml/2015/1/13/589

That was v2 after I suggested a subjectively better placement of the function
when v1 placed it as your patch IIRC. But whatever.

> 
> --- a/mm/compaction.c~mm-compactionc-fix-suitable_migration_target-unused-warning
> +++ a/mm/compaction.c
> @@ -391,28 +391,6 @@ static inline bool compact_should_abort(
>  	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
> @@ -896,6 +874,29 @@ isolate_migratepages_range(struct compac
>  
>  #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, 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>

      reply	other threads:[~2015-04-14 20:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-14  6:53 mm/compaction.c:250:13: warning: 'suitable_migration_target' defined but not used kbuild test robot
2015-04-14 19:54 ` Andrew Morton
2015-04-14 20:00   ` Vlastimil Babka [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=552D71C6.1020503@suse.cz \
    --to=vbabka@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=fabf@skynet.be \
    --cc=fengguang.wu@intel.com \
    --cc=kbuild-all@01.org \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.