From patchwork Fri Apr 14 08:03:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 13211093 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id CEB26C77B6E for ; Fri, 14 Apr 2023 08:04:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EF4C46B0075; Fri, 14 Apr 2023 04:04:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EA47E6B0078; Fri, 14 Apr 2023 04:04:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D93166B007B; Fri, 14 Apr 2023 04:04:28 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id C9F1C6B0075 for ; Fri, 14 Apr 2023 04:04:28 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 8AEA0A015B for ; Fri, 14 Apr 2023 08:04:28 +0000 (UTC) X-FDA: 80679259416.07.1350A7D Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf05.hostedemail.com (Postfix) with ESMTP id EEDCA100008 for ; Fri, 14 Apr 2023 08:04:26 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=e6CSSlSy; spf=pass (imf05.hostedemail.com: domain of arnd@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=arnd@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1681459467; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=Z0C1S8SsT3Uw9LinJ9/MGefYZ3piKnFQ+GmLg+miyUc=; b=hJxfiPCBO7Y7hDPDiBR3K5AZ9wbGkqTJpf6hLvaEIeBxM30REDuprmCbEXuHSNJd2DTU4y kHe5yRIeQmuqFNhhdbjhP1P5HmI7WFH5PybENwQKd5WE6YyZoqsy+F2n8JPgGD9kvoLGKw zyJMlob7OvqZqBjyQSOytwJJmBz17Po= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=e6CSSlSy; spf=pass (imf05.hostedemail.com: domain of arnd@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=arnd@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1681459467; a=rsa-sha256; cv=none; b=oIRAkVo1EHdlAZ9uG43d+sCWfdFl4Q+zRqlfHIwjJ5sK2uCLOfcFI1D6SJlUUCBAEZpC2k CR1LTNMPpfD/IxG6Dd7M8qWe+8lwBFwKUWL63jlfYeY8gYSS/QD1l/x1V3jDfBJgDWwZpy so/l/PiozvFPBjoN1Uqwy9PlllxwQ1E= Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E905B61509; Fri, 14 Apr 2023 08:04:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B1904C433D2; Fri, 14 Apr 2023 08:04:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1681459465; bh=kIJ6lK/Lc6cAvvvb9aZuILfOuK0T9xQHpTLzt8A9dFI=; h=From:To:Cc:Subject:Date:From; b=e6CSSlSynnb8/8SQwximjDYsEgO3iB37cizeXObEuBX6UeZi8PxJbes/BFDKFHl1r J845+gmamcoMiwEHZXspDymX/EUrJ1c0x2LpLkUaRUwb6c4sSDKK9Lu9lzza8abojD RuKF8Ji5sBj5MXlRir50HWDq3CKnkFPF18u8iPwydZ2QdJMV1Oc4gP38WMyZgvAFAw bSzc8eH4UpRLtxV1eCsP8mnq61xV61x6SEdQd8P0WPIzpHETQ62DyT0FuRhFfBlMA8 VFn8ZB8lzhZGvQZooZ11s139afw6PGuEVJO6I/2qXWP+S+ACcTnOg0CGC4JK84r2mZ 5BgtQeI+xEWQQ== From: Arnd Bergmann To: Vineet Gupta , Andrew Morton , Mike Rapoport , Nathan Chancellor , Nick Desaulniers , David Hildenbrand , Vlastimil Babka Cc: Arnd Bergmann , llvm@lists.linux.dev, Tom Rix , "Liam R. Howlett" , "Matthew Wilcox (Oracle)" , Suren Baghdasaryan , Naoya Horiguchi , linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH] mm: make arch_has_descending_max_zone_pfns() static Date: Fri, 14 Apr 2023 10:03:53 +0200 Message-Id: <20230414080418.110236-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: EEDCA100008 X-Stat-Signature: 6dq8ccas9n1ks4zjeqr8pbc6o1c14rj3 X-Rspam-User: X-HE-Tag: 1681459466-302482 X-HE-Meta: U2FsdGVkX199/Zxqfr7G/5Q9o7UGk5hGjRp3mBY3N9HhIUq7InNgAIHey5MOlfif863NnCcS3SENOOfz479RvqwvY/kEv4eXImCJDDu2dzBB8heq05w3WVsqlvc5gBTB2PwDh8Dh2urXhjB+QbSjoLVQAZnZtbBUcj+XoRU85lrXMpkVdcAEHbNQoM3ZgrkD24SaoNdZ0s3mfeqS5EWl+9/jlKnDQlPgnqsQtolBx9nGe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4RaZcnGNla7JxTQ== 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: From: Arnd Bergmann clang produces a build failure on x86 for some randconfig builds after a change that moves around code to mm/mm_init.c: Cannot find symbol for section 2: .text. mm/mm_init.o: failed I have not been able to figure out why this happens, but the __weak annotation on arch_has_descending_max_zone_pfns() is the trigger here. Removing the weak function in favor of an open-coded Kconfig option check avoids the problem and becomes clearer as well as better to optimize by the compiler. Fixes: 9420f89db2dd ("mm: move most of core MM initialization to mm/mm_init.c") Cc: llvm@lists.linux.dev Signed-off-by: Arnd Bergmann --- arch/arc/mm/init.c | 5 ----- include/linux/mm.h | 1 - mm/mm_init.c | 4 ++-- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/arch/arc/mm/init.c b/arch/arc/mm/init.c index ce4e939a7f07..2b89b6c53801 100644 --- a/arch/arc/mm/init.c +++ b/arch/arc/mm/init.c @@ -74,11 +74,6 @@ void __init early_init_dt_add_memory_arch(u64 base, u64 size) base, TO_MB(size), !in_use ? "Not used":""); } -bool arch_has_descending_max_zone_pfns(void) -{ - return !IS_ENABLED(CONFIG_ARC_HAS_PAE40); -} - /* * First memory setup routine called from setup_arch() * 1. setup swapper's mm @init_mm diff --git a/include/linux/mm.h b/include/linux/mm.h index ada57b11bb5a..a13cc121841d 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -3061,7 +3061,6 @@ extern void setup_per_cpu_pageset(void); extern int min_free_kbytes; extern int watermark_boost_factor; extern int watermark_scale_factor; -extern bool arch_has_descending_max_zone_pfns(void); /* nommu.c */ extern atomic_long_t mmap_pages_allocated; diff --git a/mm/mm_init.c b/mm/mm_init.c index 35302b7bca83..f6165747fd3e 100644 --- a/mm/mm_init.c +++ b/mm/mm_init.c @@ -1754,9 +1754,9 @@ static void __init free_area_init_memoryless_node(int nid) * Some architectures, e.g. ARC may have ZONE_HIGHMEM below ZONE_NORMAL. For * such cases we allow max_zone_pfn sorted in the descending order */ -bool __weak arch_has_descending_max_zone_pfns(void) +static bool arch_has_descending_max_zone_pfns(void) { - return false; + return !IS_ENABLED(CONFIG_ARC_HAS_PAE40); } /**