History

Merge branch 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

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()

Linus Torvalds committed 9 years ago

Commit c8b2ba82 parents 7cb328c 56713602 files · +3 −2Browse files

Unified · Split

2 files
  1. kernel/locking/qspinlock.c +1 −0
  2. kernel/locking/rwsem-spinlock.c +2 −2
kernel/locking/qspinlock.c+1−0
@@ -28,6 +28,7 @@ · 27 unmodified lines
2828 #include <linux/percpu.h>
2929 #include <linux/hardirq.h>
3030 #include <linux/mutex.h>
31+#include <linux/prefetch.h>
3132 #include <asm/byteorder.h>
3233 #include <asm/qspinlock.h>
3334
kernel/locking/rwsem-spinlock.c+2−2
@@ -231,8 +231,8 @@ int __sched __down_write_common(struct rw_semaphore *sem, int state) · 230 unmodified lines
231231
232232 out_nolock:
233233 list_del(&waiter.list);
234− if (!list_empty(&sem->wait_list))
235− __rwsem_do_wake(sem, 1);
234+ if (!list_empty(&sem->wait_list) && sem->count >= 0)
235+ __rwsem_do_wake(sem, 0);
236236 raw_spin_unlock_irqrestore(&sem->wait_lock, flags);
237237
238238 return -EINTR;