linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Balbir Singh <bsingharora@gmail.com>
To: Ganesh Mahendran <opensource.ganesh@gmail.com>
Cc: linux-mm <linux-mm@kvack.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	Vlastimil Babka <vbabka@suse.cz>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	mhocko@suse.com, mina86@mina86.com,
	Minchan Kim <minchan@kernel.org>,
	Anshuman Khandual <khandual@linux.vnet.ibm.com>
Subject: Re: [PATCH v2] mm/page_alloc: remove unnecessary order check in __alloc_pages_direct_compact
Date: Wed, 15 Jun 2016 19:40:40 +1000	[thread overview]
Message-ID: <CAKTCnzk1GZ+=ijvOm=Tw1GNGLdefovvS5wsR9XqpLLmrSSx9=g@mail.gmail.com> (raw)
In-Reply-To: <1465983258-3726-1-git-send-email-opensource.ganesh@gmail.com>

On Wed, Jun 15, 2016 at 7:34 PM, Ganesh Mahendran
<opensource.ganesh@gmail.com> wrote:
> In the callee try_to_compact_pages(), the (order == 0) is checked,
> so remove check in __alloc_pages_direct_compact.
>
> Signed-off-by: Ganesh Mahendran <opensource.ganesh@gmail.com>
> ---
> v2:
>   remove the check in __alloc_pages_direct_compact - Anshuman Khandual
> ---
>  mm/page_alloc.c | 3 ---
>  1 file changed, 3 deletions(-)
>
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index b9ea618..2f5a82a 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -3173,9 +3173,6 @@ __alloc_pages_direct_compact(gfp_t gfp_mask, unsigned int order,
>         struct page *page;
>         int contended_compaction;
>
> -       if (!order)
> -               return NULL;
> -
>         current->flags |= PF_MEMALLOC;
>         *compact_result = try_to_compact_pages(gfp_mask, order, alloc_flags, ac,
>                                                 mode, &contended_compaction);

What is the benefit of this. Is an if check more expensive than
calling the function and returning from it? I don't feel strongly
about such changes, but its good to audit the overall code for reading
and performance.

Balbir Singh

--
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:[~2016-06-15  9:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-15  9:34 Ganesh Mahendran
2016-06-15  9:40 ` Balbir Singh [this message]
2016-06-15  9:52   ` Vlastimil Babka
2016-06-15 16:41   ` Michal Nazarewicz

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='CAKTCnzk1GZ+=ijvOm=Tw1GNGLdefovvS5wsR9XqpLLmrSSx9=g@mail.gmail.com' \
    --to=bsingharora@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=khandual@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=mina86@mina86.com \
    --cc=minchan@kernel.org \
    --cc=opensource.ganesh@gmail.com \
    --cc=vbabka@suse.cz \
    /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