Re: [PATCH v4 1/3] hung_task: replace blocker_mutex with encoded blocker

From: Andrew Morton
Date: Mon Apr 07 2025 - 16:23:06 EST


On Thu, 20 Mar 2025 14:49:21 +0800 Lance Yang <ioworker0@xxxxxxxxx> wrote:

> This patch replaces 'struct mutex *blocker_mutex' with 'unsigned long
> blocker', as only one blocker is active at a time.
>
> The blocker filed can store both the lock addrees and the lock type, with
> LSB used to encode the type as Masami suggested, making it easier to extend
> the feature to cover other types of locks.
>
> Also, once the lock type is determined, we can directly extract the address
> and cast it to a lock pointer ;)
>
> ...
>
> --- a/include/linux/sched.h
> +++ b/include/linux/sched.h
> @@ -1218,7 +1218,7 @@ struct task_struct {
> #endif
>
> #ifdef CONFIG_DETECT_HUNG_TASK_BLOCKER
> - struct mutex *blocker_mutex;
> + unsigned long blocker;

-ENOCOMMENT