Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1696987imm; Thu, 19 Jul 2018 06:29:07 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcvNlgdWXCjxs0rgEHm9delRAqFg7fdka7np0KVsgfORnuj2Uo23e3ctNRaM4vIs0dE/zlR X-Received: by 2002:a63:1902:: with SMTP id z2-v6mr9824629pgl.86.1532006947825; Thu, 19 Jul 2018 06:29:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532006947; cv=none; d=google.com; s=arc-20160816; b=WYZN4/rABVPYGM9aNEzzirBeAm4/y6r/vkMJisEG4mQWG2DO+4Cx2v0/STpUH5tE6a 6KbtpLAU5V9lm/Fl5qa46X4p35SkP33y+h41t0uMuhJq2X/k/seGY1q/D1eURUhz3ByH yP57qNvrDziyhT1PP2avrsak/+9P57MiWXhXgCAps4CvAg/A46n3ant476HDsxKk/zY0 zaqdsgCN03o11DBksoUrcTmptgv9PTWHyzMyp/IO1XIt4wmVxZy1PCZXZclgthybQwDG NPZf59biTscKjY8/ZrU2YYOkRnaYblr4zUjVlfJof+tE3SaYLqVbCnCQq6pWzEay7aX4 48jA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=V9sPv61dSbXp1RajspAqziu2sUYE+jJab7rvMunh7Ms=; b=iE/ZjpzoOuqP4gm9WZxJaeCxwpFZFewVGZ9sdyJlmErok1Q9RNrFCiRvEbNzjMrTf8 c4KnZDb+h6Z9R2AsqNB68RobbxM9afJc4BOagdNS9nLU1EGR7PH2uDpD6d5w3H4GxPtc ByEzaIbf+Rus7C4UayuG7/E/mvq6y0v3GloI8bdT9o1Gz+AcNbTCMlm62bO4ifSbuoWx 5/z/xjaN0s3Qy8vBXdgJo24iWMz4U567CtYlIIbl5oNqckg+SZ2CKw0+QwnCwBGdP0/B NXEj9Rnm+G6SVyQjTPrOukZ824NMCWphKVvovK+z7RVmSbcx+KtiS3RLGxtNOF7ga1Fy VATg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b2-v6si5226785plx.88.2018.07.19.06.28.52; Thu, 19 Jul 2018 06:29:07 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731902AbeGSOLS (ORCPT + 99 others); Thu, 19 Jul 2018 10:11:18 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:43581 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731696AbeGSOK7 (ORCPT ); Thu, 19 Jul 2018 10:10:59 -0400 Received: by mail-wr1-f68.google.com with SMTP id b15-v6so8069125wrv.10 for ; Thu, 19 Jul 2018 06:27:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=V9sPv61dSbXp1RajspAqziu2sUYE+jJab7rvMunh7Ms=; b=nZRxfNUL0XjHogLbZgfLmfEPhOn9RKr+1LTJDAxpoEcjy30ptOOje93Ua6w+dm9y/3 rnq/PNRLWQ81H5mAxnXIuNPPwku0A1zhNHtCPuknjRh/a3qjPIRCV4jzYZHkwafp2V7H Oaq4XnhK4JTDrWRLxRaEUisoK8Di7H2oZHXD61be/1IkTEYcJssXs0dw9Z+G2GnClRAB kQi145uVIqwrjX1nXTs2ozyADwuRqpFHpt6ZRC0R280dniKFtWYaK5wL9scEVuSMiEus lqqKbNr/tDsEuLxidygYdhjx/vM4SDmpUae+t681OM/ayYv4zlf5wBynVGbE3+xpqtIg ozsA== X-Gm-Message-State: AOUpUlGj+WEax/U1aRsj/VHaWPt4kd8DmA8FewIPIKSCN9nkj+abTkQn cmpF8ZJbX9jUsycgiLXXVNw= X-Received: by 2002:adf:ad45:: with SMTP id p63-v6mr7306736wrc.222.1532006868257; Thu, 19 Jul 2018 06:27:48 -0700 (PDT) Received: from techadventures.net (techadventures.net. [62.201.165.239]) by smtp.gmail.com with ESMTPSA id t13-v6sm7047370wrr.74.2018.07.19.06.27.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Jul 2018 06:27:47 -0700 (PDT) Received: from d104.suse.de (charybdis-ext.suse.de [195.135.221.2]) by techadventures.net (Postfix) with ESMTPA id 58EEC124175; Thu, 19 Jul 2018 15:27:45 +0200 (CEST) From: osalvador@techadventures.net To: akpm@linux-foundation.org Cc: pasha.tatashin@oracle.com, mhocko@suse.com, vbabka@suse.cz, aaron.lu@intel.com, iamjoonsoo.kim@lge.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Oscar Salvador Subject: [PATCH v2 4/5] mm/page_alloc: Inline function to handle CONFIG_DEFERRED_STRUCT_PAGE_INIT Date: Thu, 19 Jul 2018 15:27:39 +0200 Message-Id: <20180719132740.32743-5-osalvador@techadventures.net> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180719132740.32743-1-osalvador@techadventures.net> References: <20180719132740.32743-1-osalvador@techadventures.net> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Oscar Salvador Let us move the code between CONFIG_DEFERRED_STRUCT_PAGE_INIT to an inline function. Signed-off-by: Oscar Salvador --- 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