Skip to contentSkip to conversation

hung_task: fix objtool sibling call warning in watchdog()

PATCH In review Lance Yang 2 participants 3 messages Jul 31, 2025 – Aug 1, 2025 Hung task detector

lore
Share & tools
lore

Lance Yang

author maintainer
#0 lore raw

PATCH 1/1 hung_task: fix objtool sibling call warning in watchdog()

From: Lance Yang <[email protected]>

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.

---
 kernel/hung_task.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/hung_task.c +1 -1
index 8708a1205f82..a5b5a0a2c262 100644
@@ -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;
Signature · 1 line
2.49.0
#1 lore raw
Quoted 8 lines · Lance Yang

From: Lance Yang <[email protected]>

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

Quoted 8 lines

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.

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

Quoted 21 lines
---
 kernel/hung_task.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/hung_task.c +1 -1
index 8708a1205f82..a5b5a0a2c262 100644
@@ -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;
Signature · 1 line
2.49.0
author maintainer
#2 lore raw
Quoted 14 lines · Nathan Chancellor
Quoted 13 lines · Lance Yang

From: Lance Yang <[email protected]>

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.

Quoted 8 lines
Quoted 3 lines

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

Quoted 27 lines

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

Cheers,
Nathan

Quoted 21 lines
---
  kernel/hung_task.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
kernel/hung_task.c +1 -1
index 8708a1205f82..a5b5a0a2c262 100644
@@ -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;
Signature · 1 line
2.49.0