History

locking/ww_mutex: Simplify lockdep annotations

No functional change.

Peter Zijlstra committed 5 years ago

Commit cf702ed1 parent ebf4c551 file · +10 −9Browse files

Unified · Split

kernel/locking/mutex.c+10−9
@@ -951,6 +951,10 @@ __mutex_lock_common(struct mutex *lock, unsigned int state, unsigned int subclas · 950 unmodified lines
951951 */
952952 if (ww_ctx->acquired == 0)
953953 ww_ctx->wounded = 0;
954+
955+#ifdef CONFIG_DEBUG_LOCK_ALLOC
956+ nest_lock = &ww_ctx->dep_map;
957+#endif
954958 }
955959
956960 preempt_disable();
@@ -1098,10 +1102,9 @@ __mutex_lock(struct mutex *lock, unsigned int state, unsigned int subclass, · 141 unmodified lines
10981102
10991103 static int __sched
11001104 __ww_mutex_lock(struct mutex *lock, unsigned int state, unsigned int subclass,
1101− struct lockdep_map *nest_lock, unsigned long ip,
1102− struct ww_acquire_ctx *ww_ctx)
1105+ unsigned long ip, struct ww_acquire_ctx *ww_ctx)
11031106 {
1104− return __mutex_lock_common(lock, state, subclass, nest_lock, ip, ww_ctx, true);
1107+ return __mutex_lock_common(lock, state, subclass, NULL, ip, ww_ctx, true);
11051108 }
11061109
11071110 #ifdef CONFIG_DEBUG_LOCK_ALLOC
@@ -1181,8 +1184,7 @@ ww_mutex_lock(struct ww_mutex *lock, struct ww_acquire_ctx *ctx) · 73 unmodified lines
11811184
11821185 might_sleep();
11831186 ret = __ww_mutex_lock(&lock->base, TASK_UNINTERRUPTIBLE,
1184− 0, ctx ? &ctx->dep_map : NULL, _RET_IP_,
1185− ctx);
1187+ 0, _RET_IP_, ctx);
11861188 if (!ret && ctx && ctx->acquired > 1)
11871189 return ww_mutex_deadlock_injection(lock, ctx);
11881190
@@ -1197,8 +1199,7 @@ ww_mutex_lock_interruptible(struct ww_mutex *lock, struct ww_acquire_ctx *ctx) · 8 unmodified lines
11971199
11981200 might_sleep();
11991201 ret = __ww_mutex_lock(&lock->base, TASK_INTERRUPTIBLE,
1200− 0, ctx ? &ctx->dep_map : NULL, _RET_IP_,
1201− ctx);
1202+ 0, _RET_IP_, ctx);
12021203
12031204 if (!ret && ctx && ctx->acquired > 1)
12041205 return ww_mutex_deadlock_injection(lock, ctx);
@@ -1364,7 +1365,7 @@ __mutex_lock_interruptible_slowpath(struct mutex *lock) · 159 unmodified lines
13641365 static noinline int __sched
13651366 __ww_mutex_lock_slowpath(struct ww_mutex *lock, struct ww_acquire_ctx *ctx)
13661367 {
1367− return __ww_mutex_lock(&lock->base, TASK_UNINTERRUPTIBLE, 0, NULL,
1368+ return __ww_mutex_lock(&lock->base, TASK_UNINTERRUPTIBLE, 0,
13681369 _RET_IP_, ctx);
13691370 }
13701371
@@ -1372,7 +1373,7 @@ static noinline int __sched · 1 unmodified line
13721373 __ww_mutex_lock_interruptible_slowpath(struct ww_mutex *lock,
13731374 struct ww_acquire_ctx *ctx)
13741375 {
1375− return __ww_mutex_lock(&lock->base, TASK_INTERRUPTIBLE, 0, NULL,
1376+ return __ww_mutex_lock(&lock->base, TASK_INTERRUPTIBLE, 0,
13761377 _RET_IP_, ctx);
13771378 }
13781379

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t