Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'locking-urgent-2020-11-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull locking fixes from Thomas Gleixner:
"A couple of locking fixes:

- Fix incorrect failure injection handling in the fuxtex code

- Prevent a preemption warning in lockdep when tracking
local_irq_enable() and interrupts are already enabled

- Remove more raw_cpu_read() usage from lockdep which causes state
corruption on !X86 architectures.

- Make the nr_unused_locks accounting in lockdep correct again"

* tag 'locking-urgent-2020-11-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
lockdep: Fix nr_unused_locks accounting
locking/lockdep: Remove more raw_cpu_read() usage
futex: Fix incorrect should_fail_futex() handling
lockdep: Fix preemption WARN for spurious IRQ-enable

+10 -14
+3 -1
kernel/futex.c
··· 1503 1503 */ 1504 1504 newval = FUTEX_WAITERS | task_pid_vnr(new_owner); 1505 1505 1506 - if (unlikely(should_fail_futex(true))) 1506 + if (unlikely(should_fail_futex(true))) { 1507 1507 ret = -EFAULT; 1508 + goto out_unlock; 1509 + } 1508 1510 1509 1511 ret = cmpxchg_futex_value_locked(&curval, uaddr, uval, newval); 1510 1512 if (!ret && (curval != uval)) {
+7 -13
kernel/locking/lockdep.c
··· 84 84 if (!debug_locks) 85 85 return false; 86 86 87 - if (raw_cpu_read(lockdep_recursion)) 87 + if (this_cpu_read(lockdep_recursion)) 88 88 return false; 89 89 90 90 if (current->lockdep_recursion) ··· 4057 4057 if (unlikely(in_nmi())) 4058 4058 return; 4059 4059 4060 - if (unlikely(__this_cpu_read(lockdep_recursion))) 4060 + if (unlikely(this_cpu_read(lockdep_recursion))) 4061 4061 return; 4062 4062 4063 4063 if (unlikely(lockdep_hardirqs_enabled())) { ··· 4126 4126 goto skip_checks; 4127 4127 } 4128 4128 4129 - if (unlikely(__this_cpu_read(lockdep_recursion))) 4129 + if (unlikely(this_cpu_read(lockdep_recursion))) 4130 4130 return; 4131 4131 4132 4132 if (lockdep_hardirqs_enabled()) { ··· 4396 4396 if (unlikely(hlock_class(this)->usage_mask & new_mask)) 4397 4397 goto unlock; 4398 4398 4399 + if (!hlock_class(this)->usage_mask) 4400 + debug_atomic_dec(nr_unused_locks); 4401 + 4399 4402 hlock_class(this)->usage_mask |= new_mask; 4400 4403 4401 4404 if (new_bit < LOCK_TRACE_STATES) { ··· 4406 4403 return 0; 4407 4404 } 4408 4405 4409 - switch (new_bit) { 4410 - case 0 ... LOCK_USED-1: 4406 + if (new_bit < LOCK_USED) { 4411 4407 ret = mark_lock_irq(curr, this, new_bit); 4412 4408 if (!ret) 4413 4409 return 0; 4414 - break; 4415 - 4416 - case LOCK_USED: 4417 - debug_atomic_dec(nr_unused_locks); 4418 - break; 4419 - 4420 - default: 4421 - break; 4422 4410 } 4423 4411 4424 4412 unlock: