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-2024-08-04' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull locking fixes from Thomas Gleixner:
"Two fixes for locking and jump labels:

- Ensure that the atomic_cmpxchg() conditions are correct and
evaluating to true on any non-zero value except 1. The missing
check of the return value leads to inconsisted state of the jump
label counter.

- Add a missing type conversion in the paravirt spinlock code which
makes loongson build again"

* tag 'locking-urgent-2024-08-04' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
jump_label: Fix the fix, brown paper bags galore
locking/pvqspinlock: Correct the type of "old" variable in pv_kick_node()

+3 -3
+2 -2
kernel/jump_label.c
··· 236 236 } 237 237 238 238 jump_label_lock(); 239 - if (atomic_cmpxchg(&key->enabled, 1, 0)) 239 + if (atomic_cmpxchg(&key->enabled, 1, 0) == 1) 240 240 jump_label_update(key); 241 241 jump_label_unlock(); 242 242 } ··· 289 289 return; 290 290 291 291 guard(mutex)(&jump_label_mutex); 292 - if (atomic_cmpxchg(&key->enabled, 1, 0)) 292 + if (atomic_cmpxchg(&key->enabled, 1, 0) == 1) 293 293 jump_label_update(key); 294 294 else 295 295 WARN_ON_ONCE(!static_key_slow_try_dec(key));
+1 -1
kernel/locking/qspinlock_paravirt.h
··· 357 357 static void pv_kick_node(struct qspinlock *lock, struct mcs_spinlock *node) 358 358 { 359 359 struct pv_node *pn = (struct pv_node *)node; 360 - enum vcpu_state old = vcpu_halted; 360 + u8 old = vcpu_halted; 361 361 /* 362 362 * If the vCPU is indeed halted, advance its state to match that of 363 363 * pv_wait_node(). If OTOH this fails, the vCPU was running and will