Pull locking fixes from Thomas Gleixner: - Fix the EINTR logic in rwsem-spinlock to avoid double locking by a writer and a reader - Add a missing include to qspinlocks * 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: locking/qspinlock: Explicitly include asm/prefetch.h locking/rwsem-spinlock: Fix EINTR branch in __down_write_common()
Showing the changes to kernel/locking (2 of 2 files). Show all
Unified · Split
| @@ -28,6 +28,7 @@ · 27 unmodified lines | |||
| 28 | #include <linux/percpu.h> | 28 | #include <linux/percpu.h> |
| 29 | #include <linux/hardirq.h> | 29 | #include <linux/hardirq.h> |
| 30 | #include <linux/mutex.h> | 30 | #include <linux/mutex.h> |
| 31 | #include <linux/prefetch.h> | ||
| 31 | #include <asm/byteorder.h> | 32 | #include <asm/byteorder.h> |
| 32 | #include <asm/qspinlock.h> | 33 | #include <asm/qspinlock.h> |
| 33 | 34 | ||
| @@ -231,8 +231,8 @@ int __sched __down_write_common(struct rw_semaphore *sem, int state) · 230 unmodified lines | |||
| 231 | 231 | ||
| 232 | out_nolock: | 232 | out_nolock: |
| 233 | list_del(&waiter.list); | 233 | list_del(&waiter.list); |
| 234 | if (!list_empty(&sem->wait_list)) | 234 | if (!list_empty(&sem->wait_list) && sem->count >= 0) |
| 235 | __rwsem_do_wake(sem, 1); | 235 | __rwsem_do_wake(sem, 0); |
| 236 | raw_spin_unlock_irqrestore(&sem->wait_lock, flags); | 236 | raw_spin_unlock_irqrestore(&sem->wait_lock, flags); |
| 237 | 237 | ||
| 238 | return -EINTR; | 238 | return -EINTR; |