From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754157AbcFPKRy (ORCPT ); Thu, 16 Jun 2016 06:17:54 -0400 Received: from mail-wm0-f44.google.com ([74.125.82.44]:34614 "EHLO mail-wm0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751619AbcFPKRv (ORCPT ); Thu, 16 Jun 2016 06:17:51 -0400 Date: Thu, 16 Jun 2016 12:17:48 +0200 From: Michal Hocko To: Ganesh Mahendran 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 Message-ID: <20160616101748.GF6836@dhcp22.suse.cz> References: <1466044956-3690-1-git-send-email-opensource.ganesh@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1466044956-3690-1-git-send-email-opensource.ganesh@gmail.com> User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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