public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Mel Gorman <mel@csn•ul.ie>
To: Andrew Morton <akpm@linux-foundation•org>
Cc: linux-ia64@vger•kernel.org,
	rajman mekaco <rajman.mekaco@gmail•com>,
	linux-kernel@vger•kernel.org, linux-mm@kvack•org,
	Minchan Kim <minchan.kim@gmail•com>, Tejun Heo <tj@kernel•org>,
	linuxppc-dev@lists•ozlabs.org,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp•fujitsu.com>
Subject: Re: [PATCH 1/1] page_alloc.c: remove argument to pageblock_default_order
Date: Thu, 10 May 2012 14:34:55 +0100	[thread overview]
Message-ID: <20120510133454.GG9004@csn.ul.ie> (raw)
In-Reply-To: <20120503163749.d24bf07f.akpm@linux-foundation.org>

On Thu, May 03, 2012 at 04:37:49PM -0700, Andrew Morton wrote:
> On Thu,  3 May 2012 22:45:12 +0530
> rajman mekaco <rajman.mekaco@gmail•com> wrote:
> 
> > When CONFIG_HUGETLB_PAGE_SIZE_VARIABLE is not defined, then
> > pageblock_default_order has an argument to it.
> > 
> > However, free_area_init_core will call it without any argument
> > anyway.
> > 
> > Remove the argument to pageblock_default_order when
> > CONFIG_HUGETLB_PAGE_SIZE_VARIABLE is not defined.
> > 
> > Signed-off-by: rajman mekaco <rajman.mekaco@gmail•com>
> > ---
> >  mm/page_alloc.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> > 
> > diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> > index a712fb9..4b95412 100644
> > --- a/mm/page_alloc.c
> > +++ b/mm/page_alloc.c
> > @@ -4274,7 +4274,7 @@ static inline void __init set_pageblock_order(unsigned int order)
> >   * at compile-time. See include/linux/pageblock-flags.h for the values of
> >   * pageblock_order based on the kernel config
> >   */
> > -static inline int pageblock_default_order(unsigned int order)
> > +static inline int pageblock_default_order(void)
> >  {
> >  	return MAX_ORDER-1;
> >  }
> 
> Interesting.  It has been that way since at least 3.1.
> 

/me slaps self

> It didn't break the build because pageblock_default_order() is only
> ever invoked by set_pageblock_order(), with:
> 
> 	set_pageblock_order(pageblock_default_order());
> 
> and set_pageblock_order() is a macro:
> 
> #define set_pageblock_order(x)	do {} while (0)
> 
> There's yet another reason not to use macros, dammit - they hide bugs.
> 
> 
> Mel, can you have a think about this please?  Can we just kill off
> pageblock_default_order() and fold its guts into
> set_pageblock_order(void)?  Only ia64 and powerpc can define
> CONFIG_HUGETLB_PAGE_SIZE_VARIABLE.
> 

This looks reasonable to me.

-- 
Mel Gorman
SUSE Labs

      reply	other threads:[~2012-05-10 13:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1336065312-2891-1-git-send-email-rajman.mekaco@gmail.com>
2012-05-03 23:37 ` [PATCH 1/1] page_alloc.c: remove argument to pageblock_default_order Andrew Morton
2012-05-10 13:34   ` Mel Gorman [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=20120510133454.GG9004@csn.ul.ie \
    --to=mel@csn$(echo .)ul.ie \
    --cc=akpm@linux-foundation$(echo .)org \
    --cc=kamezawa.hiroyu@jp$(echo .)fujitsu.com \
    --cc=linux-ia64@vger$(echo .)kernel.org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux-mm@kvack$(echo .)org \
    --cc=linuxppc-dev@lists$(echo .)ozlabs.org \
    --cc=minchan.kim@gmail$(echo .)com \
    --cc=rajman.mekaco@gmail$(echo .)com \
    --cc=tj@kernel$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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