Re: [PATCH 1/1] sched.h: always_inline alloc_tag_{save|restore} to fix modpost warnings
From: Andrew Morton
Date: Wed Jul 03 2024 - 23:54:26 EST
On Wed, 3 Jul 2024 20:46:11 -0700 Suren Baghdasaryan <surenb@xxxxxxxxxx> wrote:
> Ok, I confirmed that the warning is happening due to the access to
> "current" from alloc_tag_save()/alloc_tag_restore() functions. I guess
> when these functions access "thread_info" variable:
> https://elixir.bootlin.com/linux/v6.10-rc6/source/arch/xtensa/include/asm/thread_info.h#L96,
> compiler flags that because the variable is on the stack of an __init
> function while alloc_tag_save()/alloc_tag_restore() when not inlined
> are from .text section.
Well, is the warning legitimate? I don't see why an automatic variable
of an __init function should be considered to be .init storage - we can
assume it won't become an invalid reference while the .init function is
executing?