Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1714628imm; Thu, 19 Jul 2018 06:47:14 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe9ZsEyMhcaug5l/NhtIwUbrzaR6QA0ng+ec1jiATcZmEn3t4hrWysisK1SuYfBYosx124P X-Received: by 2002:a62:d1b:: with SMTP id v27-v6mr9754899pfi.87.1532008034469; Thu, 19 Jul 2018 06:47:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532008034; cv=none; d=google.com; s=arc-20160816; b=vmIjPhY9RrELCKNtk5E9iqpYW8zQdmxb16Lw6niaNYOXaZ/34WSIMKQrBadbJfBej7 S3X62eXmoqSMnhVPG2Ut87Wsd0I0stazSk6rBNHPUpXENlUMBeEEXqWkVSihkRrorMKp Qnr36MS/L24KnjBTnk5iqun25Q+cw0gs8lXfsuIgBU3fGzOdtU7+a2sqn8UWz4ZeomaP 99DLHtiNEfmli2MukoVcbjHwZT+wNq1Dqvbfjlt8aw6c1DzABHOSeEa/0SDt1MC6ZSPQ 1hcsqLoCpOi+uILtHG4BBDz+00A1t2q0T2qg58RSwr+OnZiBo4QN5ycL65IQyrv7RF33 9NMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=VzU3mMbnHlqQY28GFtYHzPf9gEc0e7J5zikHIGRCyW4=; b=qI2Sh7cIDBA4/mzlFdTcgnwkjdxuxCGsoowEJfTQ/ukYNOrJlzpCw4SJnS/7EYC6NB Ai6dhjzh0Pju+e6RHejZ6JhZm3zW3wsLcItaQbtzkyFL+vdL5hP0Vjbql3pV+/4RCbBN Qialf3hxuMAHqW9b762p6xi0Cjao/ggZCMAxoWzhB2aVoY1szFVm1nZg/ILHPPW4PROF hKrO7eniIWdCV8PSHBdvoOHBYUktu5freqvyT2l4Ik5mc439iRnodiYuPG/Y3ZnM4yqg Em/JkY9yCzW62m3v372UG2eGX7BQNy9gRDQbRDvOaI0FL8e7qFXXQaQDQqkzbCBvHsml Y3mA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a1-v6si2428704pld.63.2018.07.19.06.46.59; Thu, 19 Jul 2018 06:47:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731538AbeGSO3E (ORCPT + 99 others); Thu, 19 Jul 2018 10:29:04 -0400 Received: from mx2.suse.de ([195.135.220.15]:57410 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730521AbeGSO3D (ORCPT ); Thu, 19 Jul 2018 10:29:03 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 974ADACB7; Thu, 19 Jul 2018 13:45:47 +0000 (UTC) Date: Thu, 19 Jul 2018 15:45:46 +0200 From: Michal Hocko To: osalvador@techadventures.net Cc: akpm@linux-foundation.org, pasha.tatashin@oracle.com, vbabka@suse.cz, aaron.lu@intel.com, iamjoonsoo.kim@lge.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Oscar Salvador Subject: Re: [PATCH v2 4/5] mm/page_alloc: Inline function to handle CONFIG_DEFERRED_STRUCT_PAGE_INIT Message-ID: <20180719134546.GD7193@dhcp22.suse.cz> References: <20180719132740.32743-1-osalvador@techadventures.net> <20180719132740.32743-5-osalvador@techadventures.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180719132740.32743-5-osalvador@techadventures.net> User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 19-07-18 15:27:39, osalvador@techadventures.net wrote: > From: Oscar Salvador > > Let us move the code between CONFIG_DEFERRED_STRUCT_PAGE_INIT > to an inline function. ... to remove an ugly ifdef in the code. Please always mention _why_ in the changelog. I can clearly see what you've done in the diff. > Signed-off-by: Oscar Salvador Acked-by: Michal Hocko > --- > mm/page_alloc.c | 25 ++++++++++++++++--------- > 1 file changed, 16 insertions(+), 9 deletions(-) > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index f7a6f4e13f41..d77bc2a7ec2c 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -6379,6 +6379,21 @@ static void __ref alloc_node_mem_map(struct pglist_data *pgdat) > static void __ref alloc_node_mem_map(struct pglist_data *pgdat) { } > #endif /* CONFIG_FLAT_NODE_MEM_MAP */ > > +#ifdef CONFIG_DEFERRED_STRUCT_PAGE_INIT > +static inline void pgdat_set_deferred_range(pg_data_t *pgdat) > +{ > + /* > + * We start only with one section of pages, more pages are added as > + * needed until the rest of deferred pages are initialized. > + */ > + pgdat->static_init_pgcnt = min_t(unsigned long, PAGES_PER_SECTION, > + pgdat->node_spanned_pages); > + pgdat->first_deferred_pfn = ULONG_MAX; > +} > +#else > +static inline void pgdat_set_deferred_range(pg_data_t *pgdat) {} > +#endif > + > void __paginginit free_area_init_node(int nid, unsigned long *zones_size, > unsigned long node_start_pfn, unsigned long *zholes_size) > { > @@ -6404,16 +6419,8 @@ void __paginginit free_area_init_node(int nid, unsigned long *zones_size, > zones_size, zholes_size); > > alloc_node_mem_map(pgdat); > + pgdat_set_deferred_range(pgdat); > > -#ifdef CONFIG_DEFERRED_STRUCT_PAGE_INIT > - /* > - * We start only with one section of pages, more pages are added as > - * needed until the rest of deferred pages are initialized. > - */ > - pgdat->static_init_pgcnt = min_t(unsigned long, PAGES_PER_SECTION, > - pgdat->node_spanned_pages); > - pgdat->first_deferred_pfn = ULONG_MAX; > -#endif > free_area_init_core(pgdat); > } > > -- > 2.13.6 > -- Michal Hocko SUSE Labs