From patchwork Wed Aug 1 12:23:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oscar Salvador X-Patchwork-Id: 10552225 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D590213BB for ; Wed, 1 Aug 2018 12:24:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C60282AB72 for ; Wed, 1 Aug 2018 12:24:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BA56F2AB8A; Wed, 1 Aug 2018 12:24:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 32EE62AB72 for ; Wed, 1 Aug 2018 12:24:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 557676B0008; Wed, 1 Aug 2018 08:24:00 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 287676B0266; Wed, 1 Aug 2018 08:24:00 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EBC1A6B0005; Wed, 1 Aug 2018 08:23:59 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by kanga.kvack.org (Postfix) with ESMTP id 8738F6B0007 for ; Wed, 1 Aug 2018 08:23:59 -0400 (EDT) Received: by mail-wr1-f72.google.com with SMTP id d1-v6so14483794wrr.4 for ; Wed, 01 Aug 2018 05:23:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references; bh=jEl6v+KhyseIxz3P6IpGKnaa00NRWn3MiUa39SO2/ao=; b=ijCM8Rausqh5HG72mzHOunZkt16C6GYNYWaxazSf0UXIVNod8jvLr7B0/WwtVF373f Ez0wZx7jQk90kMQjYcK2EL1SmVct86lOWfamkxIsPe6Dd0oUpOzijDp08omlW3wQQcV7 rfZJW+4a58TbST4BRyY35kZ2LLm+ioYZzbyqo3KDj1n27Qy9N2VhBjxk0YVHo7CVeTh+ Z2Xhlx+rTqngtzLap7MT3v0EeGPJz5R0FG3vTF7C8TaDqo6OqP6B1JW8D8wjrlvY5//y jKUTY8E0MlItE9F9LZV4iun/ervsinjrS7VYQSw6dUe/qXAU3rLEWs80hS/sgX7fABXf SzCg== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of osalvador.vilardaga@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=osalvador.vilardaga@gmail.com X-Gm-Message-State: AOUpUlGRSuye6iEXwgAnWMZHhfMlflHvAgIEmfpO+UmJs6aVed6V6ZC/ d2uewZ73aUD8VfTsrpIpa+eQK/FX8SNUwK1CxWOxpy2aLbqj2QyNgpnCOCQgRTcplNWY7eU1Zdp xJNqwNa+RVYrqxMLTCtWR0TRy6oU1+NCQMl1uM5e9cBmc183SyqD5wd5+Wvc49TEH+MQcGRg7ib ovjH9306KtrtLZ//4YdYvv3zXIvcv7MGyGnJ8AlG1Rodg/125nQhxdyXWX+U+77NwlnflZJg4lv YvRf81LJtygRvnQ1sWCzga12a64ciTqtaCpKE/f3PlKF19cVRCu/UuiB6Lx7/GvAvs+paU2TC6c hiCPN+N7StxFBnJd9jpf7KcjK+FXLXZihLw9sbXpiTBvHk+Ufc7t+VJQ6KOKOnlRaPNjlpS8cQ= = X-Received: by 2002:adf:f60a:: with SMTP id t10-v6mr22291795wrp.170.1533126239026; Wed, 01 Aug 2018 05:23:59 -0700 (PDT) X-Received: by 2002:adf:f60a:: with SMTP id t10-v6mr22291742wrp.170.1533126237447; Wed, 01 Aug 2018 05:23:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533126237; cv=none; d=google.com; s=arc-20160816; b=zgLzVjHi/iDkyBq8ueUKsuZCrXS1vHD8TzjvcVcx1A870ig3J8a/4Ddj40Ytq0c3Hr CGU1fBE/6MHzztHluf0KUQYlPGCUi6B1CiInd3qpsgm0FQX4djaHrcUzlm8FFKKLib2K Mf7bLeZ0B7pQpOr01YbRCC4/SaCDg9zb7ktMT4I/7a4U5eIyI+yWovQWNE9MpsxKwfcn 3oPx2rJwNV2g4DzZ4rDK7uso6YCZ1rzlMxhnXvuTRFLkc/DwzTOZ9l98jHukuerQH9NL LNB7aEZUukg/G5R8WLgVMZ5UefPXRELi4tY/4R7u1t6ToB1xRCXYB1rl3tRCqSnsZHXJ /0xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=jEl6v+KhyseIxz3P6IpGKnaa00NRWn3MiUa39SO2/ao=; b=bIxYoURT36uN7UZAZ2U487WNFhGwmQK3HWOFDRPNY9a9XKpFWntD7nTlB86i5OJoDF 7a1IskcJL4RVYMpnW6r+7rigbqNghX/PKE/FLDHDUfhH1G+HCKTJSVGspkRnZH7YxQRG TGVmrR/WbDf7N1WLnXuhjSGikBsu1tLU46hONMOp9Xcssc0CpgAKX0S9s8upNDstcL2/ pTGKqbuFuRz0rea/8qxIINCTYs6ZlMKWgDpjZqqqJXelVS/JlTyNVhzuV+H8syCw6271 WzvUXX0cQBjLC40pUEpBzp6K/rgRJvfau/vMBtEAczCGt4QZfA9u5m6YBOTQ8sjkdZLc 3SaA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of osalvador.vilardaga@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=osalvador.vilardaga@gmail.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id l138-v6sor1396043wma.65.2018.08.01.05.23.57 for (Google Transport Security); Wed, 01 Aug 2018 05:23:57 -0700 (PDT) Received-SPF: pass (google.com: domain of osalvador.vilardaga@gmail.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; spf=pass (google.com: domain of osalvador.vilardaga@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=osalvador.vilardaga@gmail.com X-Google-Smtp-Source: AAOMgpeStQvSCKJlejEJI91o5Pl/98PLDSxrNtJvKLEtlgvJXumWAN9tFkf8nNvnJvPGM/1zxMm7nA== X-Received: by 2002:a1c:b609:: with SMTP id g9-v6mr2451453wmf.73.1533126237152; Wed, 01 Aug 2018 05:23:57 -0700 (PDT) Received: from techadventures.net (techadventures.net. [62.201.165.239]) by smtp.gmail.com with ESMTPSA id j3-v6sm24749220wrt.70.2018.08.01.05.23.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Aug 2018 05:23:56 -0700 (PDT) Received: from d104.suse.de (nat.nue.novell.com [195.135.221.2]) by techadventures.net (Postfix) with ESMTPA id 39549124541; Wed, 1 Aug 2018 14:23:55 +0200 (CEST) From: osalvador@techadventures.net To: akpm@linux-foundation.org Cc: mhocko@suse.com, vbabka@suse.cz, pasha.tatashin@oracle.com, mgorman@techsingularity.net, aaron.lu@intel.com, iamjoonsoo.kim@lge.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, dan.j.williams@intel.com, david@redhat.com Subject: [PATCH v6 3/5] mm: remove __paginginit Date: Wed, 1 Aug 2018 14:23:46 +0200 Message-Id: <20180801122348.21588-4-osalvador@techadventures.net> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180801122348.21588-1-osalvador@techadventures.net> References: <20180801122348.21588-1-osalvador@techadventures.net> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP From: Pavel Tatashin __paginginit is the same thing as __meminit except for platforms without sparsemem, there it is defined as __init. Remove __paginginit and use __meminit. Use __ref in one single function that merges __meminit and __init sections: setup_usemap(). Signed-off-by: Pavel Tatashin Reviewed-by: Oscar Salvador --- mm/internal.h | 12 ------------ mm/page_alloc.c | 19 ++++++++++--------- 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/mm/internal.h b/mm/internal.h index 33c22754d282..87256ae1bef8 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -389,18 +389,6 @@ static inline struct page *mem_map_next(struct page *iter, return iter + 1; } -/* - * FLATMEM and DISCONTIGMEM configurations use alloc_bootmem_node, - * so all functions starting at paging_init should be marked __init - * in those cases. SPARSEMEM, however, allows for memory hotplug, - * and alloc_bootmem_node is not used. - */ -#ifdef CONFIG_SPARSEMEM -#define __paginginit __meminit -#else -#define __paginginit __init -#endif - /* Memory initialisation debug and verification */ enum mminit_level { MMINIT_WARNING, diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 295977c6acae..607f98f8816d 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -6122,7 +6122,7 @@ static unsigned long __init usemap_size(unsigned long zone_start_pfn, unsigned l return usemapsize / 8; } -static void __init setup_usemap(struct pglist_data *pgdat, +static void __ref setup_usemap(struct pglist_data *pgdat, struct zone *zone, unsigned long zone_start_pfn, unsigned long zonesize) @@ -6142,7 +6142,7 @@ static inline void setup_usemap(struct pglist_data *pgdat, struct zone *zone, #ifdef CONFIG_HUGETLB_PAGE_SIZE_VARIABLE /* Initialise the number of pages represented by NR_PAGEBLOCK_BITS */ -void __paginginit set_pageblock_order(void) +void __meminit set_pageblock_order(void) { unsigned int order; @@ -6170,14 +6170,14 @@ void __paginginit set_pageblock_order(void) * include/linux/pageblock-flags.h for the values of pageblock_order based on * the kernel config */ -void __paginginit set_pageblock_order(void) +void __meminit set_pageblock_order(void) { } #endif /* CONFIG_HUGETLB_PAGE_SIZE_VARIABLE */ -static unsigned long __paginginit calc_memmap_size(unsigned long spanned_pages, - unsigned long present_pages) +static unsigned long __meminit calc_memmap_size(unsigned long spanned_pages, + unsigned long present_pages) { unsigned long pages = spanned_pages; @@ -6235,7 +6235,7 @@ static void pgdat_init_kcompactd(struct pglist_data *pgdat) {} * * NOTE: pgdat should get zeroed by caller. */ -static void __paginginit free_area_init_core(struct pglist_data *pgdat) +static void __meminit free_area_init_core(struct pglist_data *pgdat) { enum zone_type j; int nid = pgdat->node_id; @@ -6366,8 +6366,9 @@ 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 */ -void __paginginit free_area_init_node(int nid, unsigned long *zones_size, - unsigned long node_start_pfn, unsigned long *zholes_size) +void __meminit free_area_init_node(int nid, unsigned long *zones_size, + unsigned long node_start_pfn, + unsigned long *zholes_size) { pg_data_t *pgdat = NODE_DATA(nid); unsigned long start_pfn = 0; @@ -6412,7 +6413,7 @@ void __paginginit free_area_init_node(int nid, unsigned long *zones_size, * may be accessed (for example page_to_pfn() on some configuration accesses * flags). We must explicitly zero those struct pages. */ -void __paginginit zero_resv_unavail(void) +void __meminit zero_resv_unavail(void) { phys_addr_t start, end; unsigned long pfn;