]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
UBUNTU: SAUCE: (no-up) s390: fix rwlock implementation
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Fri, 11 May 2018 13:31:00 +0000 (15:31 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 23 May 2018 15:52:11 +0000 (17:52 +0200)
commit700d7728ff2ab3c6865e8308ce4c1baabbbd8f38
tree9ccbafa6a5fef4ff11a1f34fcd11d327e914932f
parent35428354d8610f6ba6c075511b5859671dc77133
UBUNTU: SAUCE: (no-up) s390: fix rwlock implementation

BugLink: http://bugs.launchpad.net/bugs/1761674
Description:  kernel: fix rwlock implementation
Symptom:      Kernel hangs, due to deadlock on an rwlock.
Problem:      With upstream commit 94232a4332de ("s390/rwlock: improve writer
              fairness") rwlock writer fairness was supposed to be
              implemented. If a writer tries to take an rwlock it sets
              unconditionally the writer bit within the lock word and waits
              until all readers have released the lock. This however can lead
              to a deadlock since rwlocks can be taken recursively by readers.
              If e.g. CPU 0 holds the lock as a reader, and CPU 1 wants to
              write-lock the lock, then CPU 1 sets the writer bit and
              afterwards busy waits for CPU 0 to release the lock. If now CPU 0
              tries to read-lock the lock again (recursively) it will also busy
              wait until CPU 1 removes the writer bit, which will never happen,
              since it waits for the first reader on CPU 0 to release the lock.
Solution:     Revert the rwlock writer fairness semantics again.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Joseph Salisbury <joseph.salisbury@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
arch/s390/lib/spinlock.c