public inbox for linux-mm@kvack.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	Johannes Weiner <hannes@cmpxchg.org>
Subject: Re: [PATCH v2 1/1] mm: page_alloc: Avoid defining unused function
Date: Tue, 23 Apr 2024 11:10:00 -0700	[thread overview]
Message-ID: <20240423111000.aaf74252a07d7e7fd56d7e12@linux-foundation.org> (raw)
In-Reply-To: <20240423161506.2637177-1-andriy.shevchenko@linux.intel.com>

On Tue, 23 Apr 2024 19:14:43 +0300 Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:

> In some configurations I got
> mm/page_alloc.c:656:20: warning: unused function 'add_to_free_list' [-Wunused-function]
> Becuase the only user is guarged with a certain ifdeffery,
> do the same for add_to_free_list().
> 
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -653,14 +653,6 @@ static inline void __add_to_free_list(struct page *page, struct zone *zone,
>  	area->nr_free++;
>  }
>  
> -static inline void add_to_free_list(struct page *page, struct zone *zone,
> -				    unsigned int order, int migratetype,
> -				    bool tail)
> -{
> -	__add_to_free_list(page, zone, order, migratetype, tail);
> -	account_freepages(zone, 1 << order, migratetype);
> -}
> -
>  /*
>   * Used for pages which are on another list. Move the pages to the tail
>   * of the list - so the moved pages won't immediately be considered for
> @@ -6776,6 +6768,14 @@ bool is_free_buddy_page(const struct page *page)
>  EXPORT_SYMBOL(is_free_buddy_page);
>  
>  #ifdef CONFIG_MEMORY_FAILURE
> +static inline void add_to_free_list(struct page *page, struct zone *zone,
> +				    unsigned int order, int migratetype,
> +				    bool tail)
> +{
> +	__add_to_free_list(page, zone, order, migratetype, tail);
> +	account_freepages(zone, 1 << order, migratetype);
> +}
> +
>  /*
>   * Break down a higher-order page in sub-pages, and keep our target out of
>   * buddy allocator.

Thanks, I'll queue this as a fix against "mm: page_alloc: consolidate
free page accounting".

Please do tell us the config when fixing these things.  That way I can
do a little bisect to ensure that I correctly identified the offending
patch.



  reply	other threads:[~2024-04-23 18:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-23 16:14 [PATCH v2 1/1] mm: page_alloc: Avoid defining unused function Andy Shevchenko
2024-04-23 18:10 ` Andrew Morton [this message]
2024-04-23 18:27   ` Andy Shevchenko
2024-04-23 20:30     ` Johannes Weiner
2024-04-23 20:45       ` Andy Shevchenko
2024-04-25  6:25 ` Miaohe Lin
2024-04-25  9:15   ` Andy Shevchenko
2024-04-25  9:45     ` Andy Shevchenko
2024-04-25 11:23       ` Miaohe Lin

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=20240423111000.aaf74252a07d7e7fd56d7e12@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux@rasmusvillemoes.dk \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox