linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: Ganesh Mahendran <opensource.ganesh@gmail.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	akpm@linux-foundation.org, vbabka@suse.cz,
	iamjoonsoo.kim@lge.com, mina86@mina86.com, minchan@kernel.org,
	mgorman@techsingularity.net, rientjes@google.com,
	kirill.shutemov@linux.intel.com, izumi.taku@jp.fujitsu.com,
	hannes@cmpxchg.org, khandual@linux.vnet.ibm.com,
	bsingharora@gmail.com
Subject: Re: [PATCH v3] mm/compaction: remove unnecessary order check in direct compact path
Date: Thu, 16 Jun 2016 12:17:48 +0200	[thread overview]
Message-ID: <20160616101748.GF6836@dhcp22.suse.cz> (raw)
In-Reply-To: <1466044956-3690-1-git-send-email-opensource.ganesh@gmail.com>

On Thu 16-06-16 10:42:36, Ganesh Mahendran wrote:
> In direct compact path, both __alloc_pages_direct_compact and
> try_to_compact_pages check (order == 0).
> 
> This patch removes the check in __alloc_pages_direct_compact() and
> move the modifying of current->flags to the entry point of direct
> page compaction where we really do the compaction.

I do not have strong opinion on whether the order should be checked at
try_to_compact_pages or __alloc_pages_direct_compact. The later one
sounds more suitable because no further steps are really appropriate for
order == 0. try_to_compact_pages is not used anywhere else to be order
aware (maybe it will in future, who knows). But this all is a matter of
taste.

[...]
> diff --git a/mm/compaction.c b/mm/compaction.c
> index fbb7b38..dcfaf57 100644
> --- a/mm/compaction.c
> +++ b/mm/compaction.c
> @@ -1686,12 +1686,16 @@ enum compact_result try_to_compact_pages(gfp_t gfp_mask, unsigned int order,
>  
>  	*contended = COMPACT_CONTENDED_NONE;
>  
> -	/* Check if the GFP flags allow compaction */
> +	/*
> +	 * Check if this is an order-0 request and
> +	 * if the GFP flags allow compaction.
> +	 */

If you are touching this comment then it would be appropriate to change
it from "what is checked" into "why it is checked" because that is far
from obvious from this context. Especially !fs/io part.

>  	if (!order || !may_enter_fs || !may_perform_io)
>  		return COMPACT_SKIPPED;
>  

That being said, I am not really sure the patch is an improvement. If
anything I would much rather see the above comment updated.

Thanks!
-- 
Michal Hocko
SUSE Labs

  reply	other threads:[~2016-06-16 10:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-16  2:42 [PATCH v3] mm/compaction: remove unnecessary order check in direct compact path Ganesh Mahendran
2016-06-16 10:17 ` Michal Hocko [this message]
2016-06-21  0:52 ` David Rientjes

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=20160616101748.GF6836@dhcp22.suse.cz \
    --to=mhocko@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=bsingharora@gmail.com \
    --cc=hannes@cmpxchg.org \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=izumi.taku@jp.fujitsu.com \
    --cc=khandual@linux.vnet.ibm.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --cc=mina86@mina86.com \
    --cc=minchan@kernel.org \
    --cc=opensource.ganesh@gmail.com \
    --cc=rientjes@google.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;
as well as URLs for NNTP newsgroup(s).