[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180523153607.GD2983@arm.com>
Date: Wed, 23 May 2018 16:36:07 +0100
From: Will Deacon <will.deacon@....com>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: psodagud@...eaurora.org, Kees Cook <keescook@...omium.org>,
Andy Lutomirski <luto@...capital.net>,
Will Drewry <wad@...omium.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Rik van Riel <riel@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Eric Biggers <ebiggers@...gle.com>,
Frederic Weisbecker <fweisbec@...il.com>, sherryy@...roid.com,
Vegard Nossum <vegard.nossum@...cle.com>,
Christoph Lameter <cl@...ux.com>,
Andrea Arcangeli <aarcange@...hat.com>,
Sasha Levin <alexander.levin@...izon.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
boqun.feng@...il.com
Subject: Re: write_lock_irq(&tasklist_lock)
[+Boqun]
On Wed, May 23, 2018 at 08:25:06AM -0700, Linus Torvalds wrote:
> On Wed, May 23, 2018 at 6:05 AM Will Deacon <will.deacon@....com> wrote:
>
> > Please use a newer kernel. We've addressed this in mainline by moving
> > arm64 over to the qrwlock implementation which (after some other changes)
> > guarantees forward progress for well-behaved readers and writers.
>
> Oh, I didn't even realize that this wasn't x86, and that there was still
> the very unfair rwlock issue on 4.14 on arm.
>
> Yeah, the queuing rwlocks shouldn't show the really pathological problems
> we used to have long ago.
Yup, although they do reveal new issues that Boqun has been running into
recently with his lockdep improvements. The general pattern is if you
have:
P0: P1: P2:
spin_lock(&slock) read_lock(&rwlock) write_lock(&rwlock)
read_lock(&rwlock) spin_lock(&slock)
then the CPUs can be queued on the rwlock such that P1 has the lock, then
P2 is queued and then P0. If P0 has taken the spinlock, we have a deadlock
which wouldn't arise with the non-queued version.
In other words, qrwlock requires consistent locking order wrt spinlocks.
Will
Powered by blists - more mailing lists