diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/mutex.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/mutex.h b/include/linux/mutex.h index a56b0ccc8a6..3793ed7feee 100644 --- a/include/linux/mutex.h +++ b/include/linux/mutex.h @@ -98,6 +98,10 @@ struct ww_acquire_ctx { #ifdef CONFIG_DEBUG_LOCK_ALLOC struct lockdep_map dep_map; #endif +#ifdef CONFIG_DEBUG_WW_MUTEX_SLOWPATH + unsigned deadlock_inject_interval; + unsigned deadlock_inject_countdown; +#endif }; struct ww_mutex { @@ -283,6 +287,10 @@ static inline void ww_acquire_init(struct ww_acquire_ctx *ctx, &ww_class->acquire_key, 0); mutex_acquire(&ctx->dep_map, 0, 0, _RET_IP_); #endif +#ifdef CONFIG_DEBUG_WW_MUTEX_SLOWPATH + ctx->deadlock_inject_interval = 1; + ctx->deadlock_inject_countdown = ctx->stamp & 0xf; +#endif } /** |