Re: [PATCH v5 2/5] alloc_tag: Introduce IOCTLs to toggle allocation tracepoints

From: Hao Ge

Date: Fri Nov 06 2026 - 02:53:22 EST


Hi Andrew

On 2026/11/6 09:21, Andrew Morton wrote:
> On Thu, 5 Nov 2026 23:15:33 +0800 kernel test robot <lkp@xxxxxxxxx> wrote:
>
>> Hi Abhishek,
>>
>> kernel test robot noticed the following build warnings:
>>
>> [auto build test WARNING on bcc036cfa1670a64500f6d857eaa71908b79e3fb]
>>
>> url: https://github.com/intel-lab-lkp/linux/commits/Abhishek-Bapat/alloc_tag-Add-trace-events-for-tracing-allocations/20261104-190336
>> base: bcc036cfa1670a64500f6d857eaa71908b79e3fb
>> patch link: https://lore.kernel.org/r/37ae7dca766994d3872fcc65b623a80d5d506369.1793818636.git.abhishekbapat%40google.com
>> patch subject: [PATCH v5 2/5] alloc_tag: Introduce IOCTLs to toggle allocation tracepoints
>> config: xtensa-randconfig-1001-20261105 (https://download.01.org/0day-ci/archive/20261105/202611052344.mDV2DB89-lkp@xxxxxxxxx/config)
>> compiler: xtensa-linux-gcc (GCC) 8.5.0
>> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261105/202611052344.mDV2DB89-lkp@xxxxxxxxx/reproduce)
>>
>> If you fix the issue in a separate patch/commit (i.e. not just a new version of
>> the same patch/commit), kindly add following tags
>> | Reported-by: kernel test robot <lkp@xxxxxxxxx>
>> | Closes: https://lore.kernel.org/oe-kbuild-all/202611052344.mDV2DB89-lkp@xxxxxxxxx/
>>
>> All warnings (new ones prefixed by >>, old ones prefixed by <<):
>>
>>>> WARNING: modpost: vmlinux: section mismatch in reference: alloc_tag_trace_enabled+0x2c (section: .text.unlikely) -> initcall_level_names (section: .init.data)
>
> Thanks.
>
> #syz test
>
> From: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
> Subject: alloc_tag: force inline the allocation tracing check
> Date: Thu, 05 Nov 2026 17:18:09 -0800
>
> alloc_tag_trace_enabled() is declared inline, but the compiler can
> still emit an out-of-line copy. Force it inline,
>
> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
> Closes: https://lore.kernel.org/oe-kbuild-all/202611052344.mDV2DB89-lkp@xxxxxxxxx/
> Cc: Abhishek Bapat <abhishekbapat@xxxxxxxxxx>
> Cc: Suren Baghdasaryan <surenb@xxxxxxxxxx>
> Cc: Hao Ge <hao.ge@xxxxxxxxx>
> ---
>
> include/linux/alloc_tag.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- a/include/linux/alloc_tag.h~alloc_tag-introduce-ioctls-to-toggle-allocation-tracepoints-fix
> +++ a/include/linux/alloc_tag.h
> @@ -161,7 +161,7 @@ static inline bool alloc_tag_is_traced(c
> return !!(atomic_read(&tag->ct.flags) & CODETAG_FLAG_TRACE_ON);
> }
>
> -static inline bool alloc_tag_trace_enabled(const struct alloc_tag *tag)
> +static __always_inline bool alloc_tag_trace_enabled(const struct alloc_tag *tag)
> {
> if (static_branch_unlikely(&alloc_tag_trace_key))
> return tag && alloc_tag_is_traced(tag);
> _
>


Thanks a lot for looking at this - and for putting together a fix at all.

Perhaps alloc_tag_is_traced needs the same treatment as well?

Even with your patch applied, I still hit the warning, just attributed to a different symbol:

WARNING: modpost: vmlinux: section mismatch in reference:
alloc_tag_is_traced+0x10 (section: .text.unlikely) -> initcall_level_names (section: .init.data)

Marking both helpers __always_inline clears the warning in my build, and it would fit what the series
intends for the fast path anyway.

Thanks
Best Regards
Hao