hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/include/linux/ww_mutex.h
....@@ -28,6 +28,14 @@
2828 unsigned int is_wait_die;
2929 };
3030
31
+struct ww_mutex {
32
+ struct mutex base;
33
+ struct ww_acquire_ctx *ctx;
34
+#ifdef CONFIG_DEBUG_MUTEXES
35
+ struct ww_class *ww_class;
36
+#endif
37
+};
38
+
3139 struct ww_acquire_ctx {
3240 struct task_struct *task;
3341 unsigned long stamp;
....@@ -45,14 +53,6 @@
4553 #ifdef CONFIG_DEBUG_WW_MUTEX_SLOWPATH
4654 unsigned int deadlock_inject_interval;
4755 unsigned int deadlock_inject_countdown;
48
-#endif
49
-};
50
-
51
-struct ww_mutex {
52
- struct mutex base;
53
- struct ww_acquire_ctx *ctx;
54
-#ifdef CONFIG_DEBUG_MUTEXES
55
- struct ww_class *ww_class;
5656 #endif
5757 };
5858
....@@ -181,9 +181,10 @@
181181 */
182182 static inline void ww_acquire_fini(struct ww_acquire_ctx *ctx)
183183 {
184
+#ifdef CONFIG_DEBUG_LOCK_ALLOC
185
+ mutex_release(&ctx->dep_map, _THIS_IP_);
186
+#endif
184187 #ifdef CONFIG_DEBUG_MUTEXES
185
- mutex_release(&ctx->dep_map, 0, _THIS_IP_);
186
-
187188 DEBUG_LOCKS_WARN_ON(ctx->acquired);
188189 if (!IS_ENABLED(CONFIG_PROVE_LOCKING))
189190 /*