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: 83274 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp212055vqo; Fri, 14 Apr 2023 01:09:52 -0700 (PDT) X-Google-Smtp-Source: AKy350br8z8ZVjoGTa5tCVpkJYYdZG78OxAglGYkmODWvfEeALYkOxskRAucaIT4bjs/UhF3bwRi X-Received: by 2002:a17:902:dac1:b0:1a6:5fe1:63be with SMTP id q1-20020a170902dac100b001a65fe163bemr2237261plx.47.1681459792127; Fri, 14 Apr 2023 01:09:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681459792; cv=none; d=google.com; s=arc-20160816; b=luaWozZS/oNgcpKjeu4Mx7pZBMq29uUetMg+lrR+G9M/920ZPuLtNfnQCULodbv7lS wfqRgyV5SAIUcGbB2HcoKZlvFXGP0sKvdlYcg6BfxcHPPOLy9EGCtGRqCRIxffz522tq OUoQC2klAMiz+Ku9d3q7wvQCj7ut27iOy8BZ0vUqkOLzT8kFnAq0VJAjoDqS72q9Fje3 UFrsL8NMarnKtu3w5l23A9jmlVvckAOTLsYSzeA2z2PDi2sWUc39CPh/PR84xorBOuQc LJ/2bcbpKkA2ecoXetI8MLiycoylvn6D3QGb/bVYoMc5gPQlHpR3aLWeJg08T/POCBLT hvEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=Z0C1S8SsT3Uw9LinJ9/MGefYZ3piKnFQ+GmLg+miyUc=; b=cVd7qvu/5B8kOmPkPbbKR+Xiiv4/FzG14InTbis7UWmR3MhWWnX6PDjAaU+OL1K54m tXxOMXdEwemggOk/lD1xfPGwbFrVEjnSkVmIZkLBtxcDeUMldSE42f8vad5krG2eV55B PWy2X6mJ2MIQwSCKqU7w0HntOgLBglm+zylMRVReaqHjWiuDwSK1dZarWJ/Fnx+VOfQG +YvAHouQ/80uC6mwM6GVApi6NBFQZu+YbplMHt9xZtiObLD89ZZ7inDYnW1jUPejOOQ2 vLsqcAHbNdbWgNMqSwCHdv0o9q2qw5zXu+Z9lmLywE/aH8y0vVISWgqF3f5FFuK42chq glRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=e6CSSlSy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h1-20020a170902f7c100b001a060012dfcsi3977150plw.114.2023.04.14.01.09.39; Fri, 14 Apr 2023 01:09:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=e6CSSlSy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229805AbjDNIE3 (ORCPT + 99 others); Fri, 14 Apr 2023 04:04:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229625AbjDNIE1 (ORCPT ); Fri, 14 Apr 2023 04:04:27 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77E811FF3 for ; Fri, 14 Apr 2023 01:04:26 -0700 (PDT) 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 0B20061610 for ; Fri, 14 Apr 2023 08:04:26 +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-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763138382814571292?= X-GMAIL-MSGID: =?utf-8?q?1763138382814571292?= 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); } /**