--- zzzz-none-000/linux-4.9.279/kernel/locking/mutex-debug.h 2021-08-08 06:38:54.000000000 +0000 +++ puma7-atom-6591-750/linux-4.9.279/kernel/locking/mutex-debug.h 2023-02-08 11:43:43.000000000 +0000 @@ -29,12 +29,28 @@ static inline void mutex_set_owner(struct mutex *lock) { + struct callerinfo *oi = &lock->owner_info; + WRITE_ONCE(lock->owner, current); + + spin_lock(&lock->owner_lock); + put_pid(oi->pid); + oi->pid = get_task_pid(current, PIDTYPE_PID); + oi->ip = _RET_IP_; + spin_unlock(&lock->owner_lock); } static inline void mutex_clear_owner(struct mutex *lock) { + struct callerinfo *oi = &lock->owner_info; + WRITE_ONCE(lock->owner, NULL); + + spin_lock(&lock->owner_lock); + put_pid(oi->pid); + oi->pid = NULL; + oi->ip = 0; + spin_unlock(&lock->owner_lock); } #define spin_lock_mutex(lock, flags) \