linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] hung_task: fix objtool sibling call warning in watchdog()
@ 2025-07-31  2:39 Lance Yang
  2025-07-31 17:59 ` Nathan Chancellor
  0 siblings, 1 reply; 3+ messages in thread
From: Lance Yang @ 2025-07-31  2:39 UTC (permalink / raw)
  To: lkp, akpm; +Cc: zi.li, llvm, mhiramat, oe-kbuild-all, linux-kernel, Lance Yang

From: Lance Yang <lance.yang@linux.dev>

The kernel test robot reported an objtool warning on the loongarch
architecture with clang:

        vmlinux.o: warning: objtool: watchdog+0x418: sibling call from
callable instruction with modified stack frame

To resolve this, explicitly prevent the compiler from inlining or
performing a tail call on check_hung_uninterruptible_tasks() by marking
it with the noinline attribute. This ensures a standard function call
with a proper stack frame, satisfying objtool's validation requirements.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202507301256.cZlxQ10s-lkp@intel.com/
Signed-off-by: Lance Yang <lance.yang@linux.dev>
---
 kernel/hung_task.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/hung_task.c b/kernel/hung_task.c
index 8708a1205f82..a5b5a0a2c262 100644
--- a/kernel/hung_task.c
+++ b/kernel/hung_task.c
@@ -283,7 +283,7 @@ static bool rcu_lock_break(struct task_struct *g, struct task_struct *t)
  * a really long time (120 seconds). If that happens, print out
  * a warning.
  */
-static void check_hung_uninterruptible_tasks(unsigned long timeout)
+static noinline void check_hung_uninterruptible_tasks(unsigned long timeout)
 {
 	int max_count = sysctl_hung_task_check_count;
 	unsigned long last_break = jiffies;
-- 
2.49.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] hung_task: fix objtool sibling call warning in watchdog()
  2025-07-31  2:39 [PATCH 1/1] hung_task: fix objtool sibling call warning in watchdog() Lance Yang
@ 2025-07-31 17:59 ` Nathan Chancellor
  2025-08-01  1:29   ` Lance Yang
  0 siblings, 1 reply; 3+ messages in thread
From: Nathan Chancellor @ 2025-07-31 17:59 UTC (permalink / raw)
  To: Lance Yang; +Cc: lkp, akpm, zi.li, llvm, mhiramat, oe-kbuild-all, linux-kernel

On Thu, Jul 31, 2025 at 10:39:34AM +0800, Lance Yang wrote:
> From: Lance Yang <lance.yang@linux.dev>
> 
> The kernel test robot reported an objtool warning on the loongarch
> architecture with clang:
> 
>         vmlinux.o: warning: objtool: watchdog+0x418: sibling call from
> callable instruction with modified stack frame
> 
> To resolve this, explicitly prevent the compiler from inlining or
> performing a tail call on check_hung_uninterruptible_tasks() by marking
> it with the noinline attribute. This ensures a standard function call
> with a proper stack frame, satisfying objtool's validation requirements.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202507301256.cZlxQ10s-lkp@intel.com/
> Signed-off-by: Lance Yang <lance.yang@linux.dev>

While this may solve that particular instance of the warning, the fact
there are many, many more with that configuration indicates that there
will need to be a more generalized fix. I have started a separate thread
with some LoongArch folks around this issue:

https://lore.kernel.org/20250731175655.GA1455142@ax162/

Cheers,
Nathan

> ---
>  kernel/hung_task.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/hung_task.c b/kernel/hung_task.c
> index 8708a1205f82..a5b5a0a2c262 100644
> --- a/kernel/hung_task.c
> +++ b/kernel/hung_task.c
> @@ -283,7 +283,7 @@ static bool rcu_lock_break(struct task_struct *g, struct task_struct *t)
>   * a really long time (120 seconds). If that happens, print out
>   * a warning.
>   */
> -static void check_hung_uninterruptible_tasks(unsigned long timeout)
> +static noinline void check_hung_uninterruptible_tasks(unsigned long timeout)
>  {
>  	int max_count = sysctl_hung_task_check_count;
>  	unsigned long last_break = jiffies;
> -- 
> 2.49.0
> 
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] hung_task: fix objtool sibling call warning in watchdog()
  2025-07-31 17:59 ` Nathan Chancellor
@ 2025-08-01  1:29   ` Lance Yang
  0 siblings, 0 replies; 3+ messages in thread
From: Lance Yang @ 2025-08-01  1:29 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: lkp, akpm, zi.li, llvm, mhiramat, oe-kbuild-all, linux-kernel



On 2025/8/1 01:59, Nathan Chancellor wrote:
> On Thu, Jul 31, 2025 at 10:39:34AM +0800, Lance Yang wrote:
>> From: Lance Yang <lance.yang@linux.dev>
>>
>> The kernel test robot reported an objtool warning on the loongarch
>> architecture with clang:
>>
>>          vmlinux.o: warning: objtool: watchdog+0x418: sibling call from
>> callable instruction with modified stack frame
>>
>> To resolve this, explicitly prevent the compiler from inlining or
>> performing a tail call on check_hung_uninterruptible_tasks() by marking
>> it with the noinline attribute. This ensures a standard function call
>> with a proper stack frame, satisfying objtool's validation requirements.
>>
>> Reported-by: kernel test robot <lkp@intel.com>
>> Closes: https://lore.kernel.org/oe-kbuild-all/202507301256.cZlxQ10s-lkp@intel.com/
>> Signed-off-by: Lance Yang <lance.yang@linux.dev>
> 
> While this may solve that particular instance of the warning, the fact
> there are many, many more with that configuration indicates that there
> will need to be a more generalized fix. I have started a separate thread
> with some LoongArch folks around this issue:

Thanks for the heads-up!

Yes, you're right, a more general fix is definitely the way to go.

I'll keep an eye on that thread and see how I can help ;)

Thanks,
Lance

> 
> https://lore.kernel.org/20250731175655.GA1455142@ax162/
> 
> Cheers,
> Nathan
> 
>> ---
>>   kernel/hung_task.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/kernel/hung_task.c b/kernel/hung_task.c
>> index 8708a1205f82..a5b5a0a2c262 100644
>> --- a/kernel/hung_task.c
>> +++ b/kernel/hung_task.c
>> @@ -283,7 +283,7 @@ static bool rcu_lock_break(struct task_struct *g, struct task_struct *t)
>>    * a really long time (120 seconds). If that happens, print out
>>    * a warning.
>>    */
>> -static void check_hung_uninterruptible_tasks(unsigned long timeout)
>> +static noinline void check_hung_uninterruptible_tasks(unsigned long timeout)
>>   {
>>   	int max_count = sysctl_hung_task_check_count;
>>   	unsigned long last_break = jiffies;
>> -- 
>> 2.49.0
>>
>>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-08-01  1:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-31  2:39 [PATCH 1/1] hung_task: fix objtool sibling call warning in watchdog() Lance Yang
2025-07-31 17:59 ` Nathan Chancellor
2025-08-01  1:29   ` Lance Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).