From patchwork Tue Dec 4 11:15:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oscar Salvador X-Patchwork-Id: 10711545 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 CB20413AF for ; Tue, 4 Dec 2018 11:15:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BCC492B19E for ; Tue, 4 Dec 2018 11:15:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B10932B3B0; Tue, 4 Dec 2018 11:15:54 +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 246F82B306 for ; Tue, 4 Dec 2018 11:15:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6E2066B6E63; Tue, 4 Dec 2018 06:15:52 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 6B9306B6E64; Tue, 4 Dec 2018 06:15:52 -0500 (EST) 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 580526B6E65; Tue, 4 Dec 2018 06:15:52 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by kanga.kvack.org (Postfix) with ESMTP id F2B676B6E63 for ; Tue, 4 Dec 2018 06:15:51 -0500 (EST) Received: by mail-ed1-f70.google.com with SMTP id w15so8058962edl.21 for ; Tue, 04 Dec 2018 03:15:51 -0800 (PST) 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; bh=+g7Obt7QIF6mu1shvUtpqpAFjLxuhANmpZxQoyQ0yS0=; b=Md4TMZc47CD9Axx+GklzYCC9mlIFJENAUfJ4L4So/G1vs341yzjDH6MTRPETQGGvSV Ihze53pUyEc1owNKen3E6ELQ2cf8X2coN0Gjx31Jwg19zIGOjmqE6QmF+YwKMLMr7kNP WgRXw97HIN+hfD5xma3SYCDgkMq5LBo/YgetSkw3Qaevgpj/gFgLIQnda2DojB062wfp KxsRB+UwX77SlJUPQY3lSv5maY/wZfq8Gh5iEB7fSEfeBq0IuvC1h41ZhsU3dhO9viEP /9A0tTgXJrWKNZK30JrzEppEViynYp6BRiav4qT8dcZkH0fvdg4BAdy8ypsEB0IJfU67 Bibw== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of osalvador@suse.de designates 195.135.221.5 as permitted sender) smtp.mailfrom=osalvador@suse.de X-Gm-Message-State: AA+aEWbuzTGgKBTEAgfWcUVV04p+kem/mx21wrg1MEA3snfalTv2wWxB u/CwyV00tp/K5cD4QK0BXwgHDJZRm66yOYXuEM/QWJpemDdOryvAjWWkXb3SiH3E8yn1mM2T50g 30Va0ebGBvzRQOOeRXPubjALO3JrrJ/7SMs9h9snegVd+oJfI/FY5n1LW5Qbx0OuLqA== X-Received: by 2002:a50:ccdd:: with SMTP id b29mr3829533edj.102.1543922151338; Tue, 04 Dec 2018 03:15:51 -0800 (PST) X-Google-Smtp-Source: AFSGD/WSP18VvUHdx9FhGTOrag81mNJ73nho0sqEmuf6tLvV5rVzZ8ouRmsiO2UCNq2+58nbRLzi X-Received: by 2002:a50:ccdd:: with SMTP id b29mr3829479edj.102.1543922150147; Tue, 04 Dec 2018 03:15:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543922150; cv=none; d=google.com; s=arc-20160816; b=E+8b3bHPU0jJVFEWuxkQCqptC0/IighF+E0AUkPD+O1i3s797YqEcvQJmw4S42qFHY FsrPonEKLZw8cpIMRd6p+lMixBsL3R5uO6z+CjkhblYWRPAHmM3W2XM8D1+D+jwP+6qU VbUYIJqFxYAPRZppsTnhiZUdvPXwJWYgUdtD1KiBX3dszwMRSpN1TYcaHUbheWbKcpS6 ex4w9szMUn/tTWNSGftBeDVNO1yGRhloIJCkofRzyVAFLdAhpcenRmpoDI0YBUHC2VFn acm2kJ8b+wIL1d698oSKGJmQ5aFBPoebq/knPJgC+MKCEF//dB9UGT3vwSCB4zEGXgKA hKKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from; bh=+g7Obt7QIF6mu1shvUtpqpAFjLxuhANmpZxQoyQ0yS0=; b=Ccph+6zsJf6CgFtnkfkviqmqVWN7xG2VxYa8bji9eaEqLJaewaCF2r+P9mzVYNke3n 5CMSI5g72vxhFBuL3rLBGPL+DadbZUD9573DulKijHbyQ3io2cxLCk8parYZL+ZsLOuK PWw2RjyNToUccNax267OYeJkxRWthoB8NLcGT9Yf8uXl2eHU2VuR19bGQxpuxyKdv/Pf jlphPnKflYD3e/c0L3etnhkradrSgAOIAiP1weFhlm6EXxStxIPRYDT0+7Uw249mQWeG sUz9GkYw86JlXZmlGASRJlJqDL/cd/xkdSLmsKoHQjBbqSv/w94lHON+YbFM4f3DALYk x1mw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of osalvador@suse.de designates 195.135.221.5 as permitted sender) smtp.mailfrom=osalvador@suse.de Received: from smtp.nue.novell.com (smtp.nue.novell.com. [195.135.221.5]) by mx.google.com with ESMTPS id u23-v6si4716884ejt.9.2018.12.04.03.15.49 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Dec 2018 03:15:50 -0800 (PST) Received-SPF: pass (google.com: domain of osalvador@suse.de designates 195.135.221.5 as permitted sender) client-ip=195.135.221.5; Authentication-Results: mx.google.com; spf=pass (google.com: domain of osalvador@suse.de designates 195.135.221.5 as permitted sender) smtp.mailfrom=osalvador@suse.de Received: from emea4-mta.ukb.novell.com ([10.120.13.87]) by smtp.nue.novell.com with ESMTP (TLS encrypted); Tue, 04 Dec 2018 12:15:49 +0100 Received: from d104.suse.de (nwb-a10-snat.microfocus.com [10.120.13.202]) by emea4-mta.ukb.novell.com with ESMTP (NOT encrypted); Tue, 04 Dec 2018 11:15:19 +0000 From: Oscar Salvador To: akpm@linux-foundation.org Cc: mhocko@suse.com, pavel.tatashin@microsoft.com, vbabka@suse.cz, alexander.h.duyck@linux.intel.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Oscar Salvador Subject: [PATCH] mm, page_alloc: Drop uneeded __meminit and __meminitdata Date: Tue, 4 Dec 2018 12:15:07 +0100 Message-Id: <20181204111507.4808-1-osalvador@suse.de> X-Mailer: git-send-email 2.13.7 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 Since commit 03e85f9d5f1 ("mm/page_alloc: Introduce free_area_init_core_hotplug"), some functions changed to only be called during system initialization. In concret, free_area_init_node and and the functions that hang from it. Also, some variables are no longer used after the system has gone through initialization. So this could be considered as a late clean-up for that patch. This patch changes the functions from __meminit to __init, and the variables from __meminitdata to __initdata. In return, we get some KBs back: Before: Freeing unused kernel image memory: 2472K After: Freeing unused kernel image memory: 2480K Signed-off-by: Oscar Salvador Reviewed-by: Wei Yang --- mm/page_alloc.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index fee5e9bad0dd..94e16eba162c 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -266,18 +266,18 @@ int watermark_boost_factor __read_mostly = 15000; int watermark_scale_factor = 10; int fragment_stall_order __read_mostly = (PAGE_ALLOC_COSTLY_ORDER + 1); -static unsigned long nr_kernel_pages __meminitdata; -static unsigned long nr_all_pages __meminitdata; -static unsigned long dma_reserve __meminitdata; +static unsigned long nr_kernel_pages __initdata; +static unsigned long nr_all_pages __initdata; +static unsigned long dma_reserve __initdata; #ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP -static unsigned long arch_zone_lowest_possible_pfn[MAX_NR_ZONES] __meminitdata; -static unsigned long arch_zone_highest_possible_pfn[MAX_NR_ZONES] __meminitdata; +static unsigned long arch_zone_lowest_possible_pfn[MAX_NR_ZONES] __initdata; +static unsigned long arch_zone_highest_possible_pfn[MAX_NR_ZONES] __initdata; static unsigned long required_kernelcore __initdata; static unsigned long required_kernelcore_percent __initdata; static unsigned long required_movablecore __initdata; static unsigned long required_movablecore_percent __initdata; -static unsigned long zone_movable_pfn[MAX_NUMNODES] __meminitdata; +static unsigned long zone_movable_pfn[MAX_NUMNODES] __initdata; static bool mirrored_kernelcore __meminitdata; /* movable_zone is the "real" zone pages in ZONE_MOVABLE are taken from */ @@ -6211,7 +6211,7 @@ void __init sparse_memory_present_with_active_regions(int nid) * with no available memory, a warning is printed and the start and end * PFNs will be 0. */ -void __meminit get_pfn_range_for_nid(unsigned int nid, +void __init get_pfn_range_for_nid(unsigned int nid, unsigned long *start_pfn, unsigned long *end_pfn) { unsigned long this_start_pfn, this_end_pfn; @@ -6260,7 +6260,7 @@ static void __init find_usable_zone_for_movable(void) * highest usable zone for ZONE_MOVABLE. This preserves the assumption that * zones within a node are in order of monotonic increases memory addresses */ -static void __meminit adjust_zone_range_for_zone_movable(int nid, +static void __init adjust_zone_range_for_zone_movable(int nid, unsigned long zone_type, unsigned long node_start_pfn, unsigned long node_end_pfn, @@ -6291,7 +6291,7 @@ static void __meminit adjust_zone_range_for_zone_movable(int nid, * Return the number of pages a zone spans in a node, including holes * present_pages = zone_spanned_pages_in_node() - zone_absent_pages_in_node() */ -static unsigned long __meminit zone_spanned_pages_in_node(int nid, +static unsigned long __init zone_spanned_pages_in_node(int nid, unsigned long zone_type, unsigned long node_start_pfn, unsigned long node_end_pfn, @@ -6326,7 +6326,7 @@ static unsigned long __meminit zone_spanned_pages_in_node(int nid, * Return the number of holes in a range on a node. If nid is MAX_NUMNODES, * then all holes in the requested range will be accounted for. */ -unsigned long __meminit __absent_pages_in_range(int nid, +unsigned long __init __absent_pages_in_range(int nid, unsigned long range_start_pfn, unsigned long range_end_pfn) { @@ -6356,7 +6356,7 @@ unsigned long __init absent_pages_in_range(unsigned long start_pfn, } /* Return the number of page frames in holes in a zone on a node */ -static unsigned long __meminit zone_absent_pages_in_node(int nid, +static unsigned long __init zone_absent_pages_in_node(int nid, unsigned long zone_type, unsigned long node_start_pfn, unsigned long node_end_pfn, @@ -6408,7 +6408,7 @@ static unsigned long __meminit zone_absent_pages_in_node(int nid, } #else /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */ -static inline unsigned long __meminit zone_spanned_pages_in_node(int nid, +static inline unsigned long __init zone_spanned_pages_in_node(int nid, unsigned long zone_type, unsigned long node_start_pfn, unsigned long node_end_pfn, @@ -6427,7 +6427,7 @@ static inline unsigned long __meminit zone_spanned_pages_in_node(int nid, return zones_size[zone_type]; } -static inline unsigned long __meminit zone_absent_pages_in_node(int nid, +static inline unsigned long __init zone_absent_pages_in_node(int nid, unsigned long zone_type, unsigned long node_start_pfn, unsigned long node_end_pfn, @@ -6441,7 +6441,7 @@ static inline unsigned long __meminit zone_absent_pages_in_node(int nid, #endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */ -static void __meminit calculate_node_totalpages(struct pglist_data *pgdat, +static void __init calculate_node_totalpages(struct pglist_data *pgdat, unsigned long node_start_pfn, unsigned long node_end_pfn, unsigned long *zones_size,