From: David Rientjes <rientjes@google.com>
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, mhocko@suse.com, mina86@mina86.com,
minchan@kernel.org, mgorman@techsingularity.net,
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: Mon, 20 Jun 2016 17:52:43 -0700 (PDT) [thread overview]
Message-ID: <alpine.DEB.2.10.1606201749110.133174@chino.kir.corp.google.com> (raw)
In-Reply-To: <1466044956-3690-1-git-send-email-opensource.ganesh@gmail.com>
On Thu, 16 Jun 2016, Ganesh Mahendran wrote:
> 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.
> + */
This seems obvious.
> if (!order || !may_enter_fs || !may_perform_io)
> return COMPACT_SKIPPED;
>
> trace_mm_compaction_try_to_compact_pages(order, gfp_mask, mode);
>
> + current->flags |= PF_MEMALLOC;
> /* Compact each zone in the list */
> for_each_zone_zonelist_nodemask(zone, z, ac->zonelist, ac->high_zoneidx,
> ac->nodemask) {
> @@ -1768,6 +1772,7 @@ break_loop:
> all_zones_contended = 0;
> break;
> }
> + current->flags &= ~PF_MEMALLOC;
>
> /*
> * If at least one zone wasn't deferred or skipped, we report if all
Compaction don't touch task_struct flags and PF_MEMALLOC is flag used
primarily by the page allocator, moving this to try_to_compact_pages()
doesn't make sense.
You could remove the !order check in try_to_compact_pages(), but I don't
think it offers anything substantial.
--
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>
prev parent reply other threads:[~2016-06-21 0:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-16 2:42 Ganesh Mahendran
2016-06-16 10:17 ` Michal Hocko
2016-06-21 0:52 ` David Rientjes [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=alpine.DEB.2.10.1606201749110.133174@chino.kir.corp.google.com \
--to=rientjes@google.com \
--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=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