The distinction is that assert_spin_locked() checks if the lock is held *by*anyone* whereas lockdep_assert_held() asserts the current context holds the lock. Also, the check goes away if you build without lockdep.
Showing the changes to kernel (1 of 1 file). Show all
Unified · Split
| @@ -884,7 +884,7 @@ static int check_kill_permission(int sig, struct kernel_siginfo *info, · 883 unmodified lines | ||
| 884 | 884 | static void ptrace_trap_notify(struct task_struct *t) |
| 885 | 885 | { |
| 886 | 886 | WARN_ON_ONCE(!(t->ptrace & PT_SEIZED)); |
| 887 | − assert_spin_locked(&t->sighand->siglock); | |
| 887 | + lockdep_assert_held(&t->sighand->siglock); | |
| 888 | 888 | |
| 889 | 889 | task_set_jobctl_pending(t, JOBCTL_TRAP_NOTIFY); |
| 890 | 890 | ptrace_signal_wake_up(t, t->jobctl & JOBCTL_LISTENING); |
| @@ -1079,7 +1079,7 @@ static int __send_signal_locked(int sig, struct kernel_siginfo *info, · 188 unmodified lines | ||
| 1079 | 1079 | int override_rlimit; |
| 1080 | 1080 | int ret = 0, result; |
| 1081 | 1081 | |
| 1082 | − assert_spin_locked(&t->sighand->siglock); | |
| 1082 | + lockdep_assert_held(&t->sighand->siglock); | |
| 1083 | 1083 | |
| 1084 | 1084 | result = TRACE_SIGNAL_IGNORED; |
| 1085 | 1085 | if (!prepare_signal(sig, t, force)) |