Repository navigation
Commit 7811d6f
committed
spinlock: mark spinlock unlocked before releasing the lock
The spin_unlock()/spin_unlock_irqrestore() path cleared the holder
after spin_unlock_notrace() had already released the lock value. On
SMP this leaves a window in which another thread may acquire the lock
(see lock == unlocked) while info->holder still refers to the previous
owner, so mark_locked() misreports a relock. Reorder to match the
downstream semantics: mark the spinlock as unlocked first, then release
the lock value, then emit the trace note.
The recursive (rspin) unlock path already used the correct order.
This is a series-original fix: it restores the mark-before-release
ordering of the original downstream implementation (regression against
the merged debug-tools series).
Assisted-By: mimo-v2.6-pro
Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>1 parent 237f0b6 commit 7811d6f
1 file changed
Lines changed: 8 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
408 | 408 | | |
409 | 409 | | |
410 | 410 | | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
411 | 415 | | |
412 | 416 | | |
413 | 417 | | |
414 | 418 | | |
415 | 419 | | |
416 | 420 | | |
417 | 421 | | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | 422 | | |
423 | 423 | | |
424 | 424 | | |
| |||
1033 | 1033 | | |
1034 | 1034 | | |
1035 | 1035 | | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
1036 | 1040 | | |
1037 | 1041 | | |
1038 | 1042 | | |
1039 | 1043 | | |
1040 | 1044 | | |
1041 | 1045 | | |
1042 | 1046 | | |
1043 | | - | |
1044 | | - | |
1045 | | - | |
1046 | | - | |
1047 | 1047 | | |
1048 | 1048 | | |
1049 | 1049 | | |
| |||
0 commit comments