Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp688782pxj; Fri, 14 May 2021 13:10:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyMSViQ4HJMiHlSi9pBV8xuY+3VQCRBo4GHjxnD/Hc6Fo3vFZJ6pFP1DSTVzyDAEW8K3ZHW X-Received: by 2002:a17:906:640c:: with SMTP id d12mr21699438ejm.70.1621023026339; Fri, 14 May 2021 13:10:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621023026; cv=none; d=google.com; s=arc-20160816; b=DVAFfOm1heA5yGdUp+BqhmuH/W1QlWFXjNSEhffkdn0k2C4Bj9LZY5CqYZIlEHdYHd KE+tSYXDhw5zPq13HEMwo0p/3e5NzNyj/vZHzVJYVHApeUQ+t6BEkCXE7V8or56TOnhS jW6xLQGxrJ08nmTv4YtJnhTTIy16WD7Ev7P9MBbo2ELveCrJM7eMKFhozM+wWany71mc R63WDFEWUZEvWA5anyBTSFYTLwVw6+KBjrOkQQoNLCRchf0oDxCyxPFkGtcTC2MjX/aN yakSxdM8VCo4WIebhduTk9EYasVFFOdveCSgZUl4x6s4+4lK6PwilQHzIRriD+zQ8jnn ERpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=PwHOZ9mMay2e+lnCUmViu//dj+6wMvFlVF1VF8dlLFs=; b=Toc5y1kUskhqbnT0OjDOQhNv+Eq8fwTBKWBpz2CdqK03INROYA2yazeEZq+AwsChm1 PpdwUkX3fkw61xtbVuBxsv6MGZnQXy7gNpU/7K7i0hL+wAbpXlSmRJLx7H/hnTq8e8Lb 0iqUk9g3/eIWzrhU19i+ZmPeCdQFs1hLQopKNbOSNzcWRn602Zmx9h1OrOILzcrsd084 dzhj+fr/Xxz2FkURFmFFCsKEITPtBqgH9Vk6NMYeK+cmh5JsJTEyRme+DEwF84nMihfw 8enmZGFo76iwUuO+cC0Hn2MVLhC9C9x7QtvuHtwVYlGeNHGkgQYKz/o3K3BH1sdTEAuB zCng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GR4deiUK; 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 o19si6208394edq.609.2021.05.14.13.10.02; Fri, 14 May 2021 13:10:26 -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=GR4deiUK; 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 S232585AbhENRtg (ORCPT + 99 others); Fri, 14 May 2021 13:49:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:48674 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229445AbhENRtf (ORCPT ); Fri, 14 May 2021 13:49:35 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id AAC55613EC; Fri, 14 May 2021 17:48:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1621014504; bh=a2Lf/s9pS2AbNJ05MvIWyGXG/TI/DKSvCkpHiv0i2Oo=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=GR4deiUKmR3hcwLhTbJZMLVSJw5ACynGwuXnVCEI/+gZ/Hpo0k5+g5m8WNIhfGX1S TjRcCC9I2qx8F6rvIy9hgHuMQgsmtGVjTobx9zBM8E4GTxe4JsfFMYC8GGJN61GzEv KiCk5INxFn8KUHihlZaq1dQYvsURZ6XA/Xe4PLdiJYrenBI79VKl7meePcvHxjnOxP fHM2UKv17p2lRlCElTRGm/WqhwttWF0YgJ5K6h7Ugx9XOBqM2Wk+TpRIJmRLlvZ2S8 71/vdgJuAyGI2bBSMloBvzYkafUl2wLKe2PGymvvRAbEsqZD3lPgJO4IiuOmzH5Bu3 I9yqqvOyCb9Dw== Subject: Re: [PATCH] mm/shuffle: fix section mismatch warning To: Arnd Bergmann , Andrew Morton , 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 References: <20210514135952.2928094-1-arnd@kernel.org> From: Nathan Chancellor Message-ID: <1904893e-1e7f-b1a4-454c-6999f8ac670a@kernel.org> Date: Fri, 14 May 2021 10:48:22 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20210514135952.2928094-1-arnd@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/14/2021 6:59 AM, Arnd Bergmann wrote: > 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: 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; >