--- zzzz-none-000/linux-3.10.107/include/linux/mutex.h 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/include/linux/mutex.h 2021-02-04 17:41:59.000000000 +0000 @@ -10,12 +10,14 @@ #ifndef __LINUX_MUTEX_H #define __LINUX_MUTEX_H +#include #include #include #include #include - #include +#include +#include /* * Simple, straightforward mutexes with strict semantics: @@ -50,14 +52,13 @@ atomic_t count; spinlock_t wait_lock; struct list_head wait_list; -#if defined(CONFIG_DEBUG_MUTEXES) || defined(CONFIG_SMP) +#if defined(CONFIG_DEBUG_MUTEXES) || defined(CONFIG_MUTEX_SPIN_ON_OWNER) struct task_struct *owner; #endif #ifdef CONFIG_MUTEX_SPIN_ON_OWNER - void *spin_mlock; /* Spinner MCS lock */ + struct optimistic_spin_queue osq; /* Spinner MCS lock */ #endif #ifdef CONFIG_DEBUG_MUTEXES - const char *name; void *magic; #endif #ifdef CONFIG_DEBUG_LOCK_ALLOC @@ -130,12 +131,13 @@ } /* - * See kernel/mutex.c for detailed documentation of these APIs. - * Also see Documentation/mutex-design.txt. + * See kernel/locking/mutex.c for detailed documentation of these APIs. + * Also see Documentation/locking/mutex-design.txt. */ #ifdef CONFIG_DEBUG_LOCK_ALLOC extern void mutex_lock_nested(struct mutex *lock, unsigned int subclass); extern void _mutex_lock_nest_lock(struct mutex *lock, struct lockdep_map *nest_lock); + extern int __must_check mutex_lock_interruptible_nested(struct mutex *lock, unsigned int subclass); extern int __must_check mutex_lock_killable_nested(struct mutex *lock, @@ -147,7 +149,7 @@ #define mutex_lock_nest_lock(lock, nest_lock) \ do { \ - typecheck(struct lockdep_map *, &(nest_lock)->dep_map); \ + typecheck(struct lockdep_map *, &(nest_lock)->dep_map); \ _mutex_lock_nest_lock(lock, &(nest_lock)->dep_map); \ } while (0) @@ -170,10 +172,7 @@ */ extern int mutex_trylock(struct mutex *lock); extern void mutex_unlock(struct mutex *lock); -extern int atomic_dec_and_mutex_lock(atomic_t *cnt, struct mutex *lock); -#ifndef CONFIG_HAVE_ARCH_MUTEX_CPU_RELAX -#define arch_mutex_cpu_relax() cpu_relax() -#endif +extern int atomic_dec_and_mutex_lock(atomic_t *cnt, struct mutex *lock); -#endif +#endif /* __LINUX_MUTEX_H */