Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp642012pxj; Fri, 14 May 2021 11:54:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzmA37LSV6RGxAmv1yFQYEeuv0wwMx4SI/EeguGJwjCNaFjKEg6Y9cZEovzlx/kUOg3ViTR X-Received: by 2002:a50:9f6b:: with SMTP id b98mr6305343edf.318.1621018465842; Fri, 14 May 2021 11:54:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621018465; cv=none; d=google.com; s=arc-20160816; b=HfAeryL2CE8cPfGiem0HR4MepRBlCZuCgBXp6Cng0s+3NivkdBSVyM2iBJtGh2wzOU SPs/m5Ib0pK7P8DERj4aeTPzVh19w6Rv7udZfaIblAgeLk931N2j5sLRmWSXE3TlnqFJ wetVAZR0OpysFOsAex+F998FIz/44sZtsDIueqqMMaUghBfdYg5mcBmBp1qsFOmKm4Kr HbpY0oLbZgJeQ9/UcgWFpP8I9/ZuCTdK+Dww/Er46wxerppAmmR0eP7eN7qapapc3p5E tm0O4N0Jaq1rux+i/LPnOTsuDguN2XU7O+TwXupfdMXL51UOp6fUHFtVf2ItDIkRgqVC q6yA== 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=CTnTBqRuc3lyLGEf5emBKvPR1WhrNPfm7mAqvVaf7UM=; b=zOLqCwKBuYp999JXjEKuHYyZmymOwqhEG53CvYxN5eL7R0nMcWr94M4/1D1Hs40X1N 0p4sXAWwKJCF+kKJkvy2hoAdLwCgAzkOl5GTp1O3PvyZrwUBcbv8N7TMLEGfss26k9ql KAzWUwML/B/b7PouJ/JZLzhy0s2qMdBkgfk6HBpxvvt6xhIbCLBC7JqRjRNa99XPiJT7 rbxfN73puM+C8KIyboHRA4vsccZb3PcWJLqWSS8qubInZ1T/ww659RSgrKJ/V0U+FpUR Fp2Sq714N/jthS7T6nYca4UyDZVUzMb5eIgZFCg7J+unGKAsMUMHKhTeO8RCmx8fnlMU TpNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TrZQ1cvC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w10si5180612edq.435.2021.05.14.11.54.02; Fri, 14 May 2021 11:54:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TrZQ1cvC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S232874AbhENOBy (ORCPT + 99 others); Fri, 14 May 2021 10:01:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:59656 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230229AbhENOBx (ORCPT ); Fri, 14 May 2021 10:01:53 -0400 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 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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; -- 2.29.2