From: Reinette Chatre <reinette.chatre@intel.com>
To: Nathan Chancellor <nathan@kernel.org>,
Fenghua Yu <fenghua.yu@intel.com>, <x86@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>
Cc: <linux-kernel@vger.kernel.org>, <llvm@lists.linux.dev>,
<patches@lists.linux.dev>
Subject: Re: [PATCH] x86/resctrl: Annotate __get_mem_config_intel() as __init
Date: Thu, 12 Sep 2024 15:33:09 -0700 [thread overview]
Message-ID: <fc49e252-6283-4a37-b4e8-bd329f326e68@intel.com> (raw)
In-Reply-To: <20240822-x86-restctrl-get_mem_config_intel-init-v1-1-8b0a68a8731a@kernel.org>
Hi Nathan,
Apologies for the delay.
On 8/22/24 5:12 PM, Nathan Chancellor wrote:
> After a recent LLVM change [1] that deduces __cold on functions that
> only call cold code (such as __init functions), there is a section
> mismatch warning from __get_mem_config_intel(), which got moved to
> .text.unlikely. as a result of that optimization:
>
> WARNING: modpost: vmlinux: section mismatch in reference: __get_mem_config_intel+0x77 (section: .text.unlikely.) -> thread_throttle_mode_init (section: .init.text)
>
> Mark __get_mem_config_intel() as __init as well since it is only called
> from __init code, which clears up the warning.
It looks to me as though __rdt_get_mem_config_amd() may need the same __init
treatment and it is not clear to me why __get_mem_config_intel() would trigger
such warning, but not __rdt_get_mem_config_amd()?
>
> Link: https://github.com/llvm/llvm-project/commit/6b11573b8c5e3d36beee099dbe7347c2a007bf53 [1]
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> ---
> arch/x86/kernel/cpu/resctrl/core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resctrl/core.c
> index 1930fce9dfe9..b28646f1d9d6 100644
> --- a/arch/x86/kernel/cpu/resctrl/core.c
> +++ b/arch/x86/kernel/cpu/resctrl/core.c
> @@ -199,7 +199,7 @@ static inline bool rdt_get_mb_table(struct rdt_resource *r)
> return false;
> }
>
> -static bool __get_mem_config_intel(struct rdt_resource *r)
> +static bool __init __get_mem_config_intel(struct rdt_resource *r)
Surely resctrl is not consistent in this regard but I understand from the coding style
doc that storage class should precede the return type, so perhaps:
static __init bool __get_mem_config_intel(struct rdt_resource *r)
We may need to follow this recommended style for this to be included.
> {
> struct rdt_hw_resource *hw_res = resctrl_to_arch_res(r);
> union cpuid_0x10_3_eax eax;
>
> ---
> base-commit: 7424fc6b86c8980a87169e005f5cd4438d18efe6
> change-id: 20240822-x86-restctrl-get_mem_config_intel-init-3af02a5130ba
>
> Best regards,
Thank you very much.
Reinette
next prev parent reply other threads:[~2024-09-12 22:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-23 0:12 [PATCH] x86/resctrl: Annotate __get_mem_config_intel() as __init Nathan Chancellor
2024-09-12 22:33 ` Reinette Chatre [this message]
2024-09-13 19:41 ` Nathan Chancellor
2024-09-13 21:40 ` Reinette Chatre
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fc49e252-6283-4a37-b4e8-bd329f326e68@intel.com \
--to=reinette.chatre@intel.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=fenghua.yu@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=mingo@redhat.com \
--cc=nathan@kernel.org \
--cc=patches@lists.linux.dev \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox