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 branch 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull locking fix from Ingo Molnar:
"A single fix for a locking self-test crash"

* 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
locking/pvqspinlock: Fix kernel panic in locking-selftest

+10 -1
+10 -1
kernel/locking/qspinlock_paravirt.h
··· 4 4 5 5 #include <linux/hash.h> 6 6 #include <linux/bootmem.h> 7 + #include <linux/debug_locks.h> 7 8 8 9 /* 9 10 * Implement paravirt qspinlocks; the general idea is to halt the vcpus instead ··· 287 286 { 288 287 struct __qspinlock *l = (void *)lock; 289 288 struct pv_node *node; 289 + u8 lockval = cmpxchg(&l->locked, _Q_LOCKED_VAL, 0); 290 290 291 291 /* 292 292 * We must not unlock if SLOW, because in that case we must first 293 293 * unhash. Otherwise it would be possible to have multiple @lock 294 294 * entries, which would be BAD. 295 295 */ 296 - if (likely(cmpxchg(&l->locked, _Q_LOCKED_VAL, 0) == _Q_LOCKED_VAL)) 296 + if (likely(lockval == _Q_LOCKED_VAL)) 297 297 return; 298 + 299 + if (unlikely(lockval != _Q_SLOW_VAL)) { 300 + if (debug_locks_silent) 301 + return; 302 + WARN(1, "pvqspinlock: lock %p has corrupted value 0x%x!\n", lock, atomic_read(&lock->val)); 303 + return; 304 + } 298 305 299 306 /* 300 307 * Since the above failed to release, this must be the SLOW path.