Re: [PATCH v4 2/3] hung_task: show the blocker task if the task is hung on semaphore
From: Andrew Morton
Date: Mon Apr 07 2025 - 16:15:22 EST
On Thu, 20 Mar 2025 14:49:22 +0800 Lance Yang <ioworker0@xxxxxxxxx> wrote:
> --- a/kernel/locking/semaphore.c
> +++ b/kernel/locking/semaphore.c
> @@ -33,12 +33,14 @@
> #include <linux/spinlock.h>
> #include <linux/ftrace.h>
> #include <trace/events/lock.h>
> +#include <linux/hung_task.h>
>
> static noinline void __down(struct semaphore *sem);
> static noinline int __down_interruptible(struct semaphore *sem);
> static noinline int __down_killable(struct semaphore *sem);
> static noinline int __down_timeout(struct semaphore *sem, long timeout);
> static noinline void __up(struct semaphore *sem);
> +static inline void __sem_acquire(struct semaphore *sem);
It feels Just Weird to forward declare a static inline. Is there a
special reason for doing this?