From patchwork Fri May 14 13:59:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 12257831 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 01CF7C433ED for ; Fri, 14 May 2021 14:01:47 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8116E61461 for ; Fri, 14 May 2021 14:01:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8116E61461 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 10D0C6B0036; Fri, 14 May 2021 10:01:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0E4AD6B006E; Fri, 14 May 2021 10:01:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EF0D26B0070; Fri, 14 May 2021 10:01:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0056.hostedemail.com [216.40.44.56]) by kanga.kvack.org (Postfix) with ESMTP id BBCA86B0036 for ; Fri, 14 May 2021 10:01:45 -0400 (EDT) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 55B5B180322C6 for ; Fri, 14 May 2021 14:01:45 +0000 (UTC) X-FDA: 78139999770.17.D2D012E Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf28.hostedemail.com (Postfix) with ESMTP id 79BBB2000AF6 for ; Fri, 14 May 2021 14:00:42 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 3380D6101A; Fri, 14 May 2021 14:00:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1621000842; bh=QO8k/jSE1zp7BeVRCZZeywW1fgcMVXNir/KR3YgKKxQ=; h=From:To:Cc:Subject:Date:From; b=TrZQ1cvCeAYQ3JQMLFvWzrexTwvmlpaISJVbAjKvT8PGfzPmKWJHz9s5MPmWgsiZv 81iXwP1zAb7crjuwdaCidK8Im2NRws45imYCZr6Y46sT8lag6fvcN1f+Hog2cfWl0L R+S2ARTuupNUTsZmI3FaDq7b1mLNRC2MQ1AMYVbfIYYOiNVfyOcMZIoENX3NbmYqgf EWuzAkM9db5HDqlVl1jyVUFMQi7e1t2YoW6kJAnYTo/HBaVCEAs8A+ToqjQmS7lFlh 1C0L6vltKXPgptoIauukkMkPJlJKK5BZxGYw1y+1r9Wo31Qc7SDbrGpNjK6uYDy32I tymj2AJR2BvoQ== From: Arnd Bergmann To: Andrew Morton , Nathan Chancellor , Nick Desaulniers Cc: Arnd Bergmann , David Hildenbrand , Wei Yang , Dan Williams , linux-mm@kvack.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com Subject: [PATCH] mm/shuffle: fix section mismatch warning Date: Fri, 14 May 2021 15:59:48 +0200 Message-Id: <20210514135952.2928094-1-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 X-Rspamd-Queue-Id: 79BBB2000AF6 Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=TrZQ1cvC; spf=pass (imf28.hostedemail.com: domain of arnd@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=arnd@kernel.org; dmarc=pass (policy=none) header.from=kernel.org X-Rspamd-Server: rspam04 X-Stat-Signature: mhcg8mxkxpco6athwtkhaxe557fh7gew X-HE-Tag: 1621000842-651307 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 sometimes decides not to inline shuffle_zone(), but it calls a __meminit function. Without the extra __meminit annotation we get this warning: WARNING: modpost: vmlinux.o(.text+0x2a86d4): Section mismatch in reference from the function shuffle_zone() to the function .meminit.text:__shuffle_zone() The function shuffle_zone() references the function __meminit __shuffle_zone(). This is often because shuffle_zone lacks a __meminit annotation or the annotation of __shuffle_zone is wrong. shuffle_free_memory() did not show the same problem in my tests, but it could happen in theory as well, so mark both as __meminit. Signed-off-by: Arnd Bergmann Reviewed-by: David Hildenbrand Reviewed-by: Nathan Chancellor --- mm/shuffle.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/shuffle.h b/mm/shuffle.h index 71b784f0b7c3..cec62984f7d3 100644 --- a/mm/shuffle.h +++ b/mm/shuffle.h @@ -10,7 +10,7 @@ DECLARE_STATIC_KEY_FALSE(page_alloc_shuffle_key); extern void __shuffle_free_memory(pg_data_t *pgdat); extern bool shuffle_pick_tail(void); -static inline void shuffle_free_memory(pg_data_t *pgdat) +static inline void __meminit shuffle_free_memory(pg_data_t *pgdat) { if (!static_branch_unlikely(&page_alloc_shuffle_key)) return; @@ -18,7 +18,7 @@ static inline void shuffle_free_memory(pg_data_t *pgdat) } extern void __shuffle_zone(struct zone *z); -static inline void shuffle_zone(struct zone *z) +static inline void __meminit shuffle_zone(struct zone *z) { if (!static_branch_unlikely(&page_alloc_shuffle_key)) return;