[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181123113130.GA3360@arrakis.emea.arm.com>
Date: Fri, 23 Nov 2018 11:31:31 +0000
From: Catalin Marinas <catalin.marinas@....com>
To: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Cc: Andrea Parri <andrea.parri@...rulasolutions.com>,
Peter Zijlstra <peterz@...radead.org>, zhe.he@...driver.com,
tglx@...utronix.de, rostedt@...dmis.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, linux-rt-users@...r.kernel.org,
boqun.feng@...il.com
Subject: Re: [PATCH v2] kmemleak: Turn kmemleak_lock to raw spinlock on RT
On Fri, Nov 23, 2018 at 12:06:11PM +0100, Sebastian Andrzej Siewior wrote:
> On 2018-11-23 12:02:55 [+0100], Andrea Parri wrote:
> > > is this an RT-only problem? Because mainline should not allow read->read
> > > locking or read->write locking for reader-writer locks. If this only
> > > happens on v4.18 and not on v4.19 then something must have fixed it.
> >
> > Probably misunderstanding, but I'd say that read->read locking is "the
> > norm"...?
> >
> > If you don't use qrwlock, readers are also "recursive", in part.,
> >
> > P0 P1
> > read_lock(l)
> > write_lock(l)
> > read_lock(l)
> >
> > won't block P0 on the second read_lock(). (qrwlock somehow complicate
> > the analysis; IIUC, they are recursive if and only if in_interrupt().).
>
> ehm, peterz, is that true? My memory on that is that all readers will
> block if there is a writer pending.
With qwrlocks, the readers will normally block if there is a pending
writer (to avoid starving the writer), unless in_interrupt() when the
readers are allowed to starve a pending writer.
TLA+/PlusCal model here: ;)
https://git.kernel.org/pub/scm/linux/kernel/git/cmarinas/kernel-tla.git/tree/qrwlock.tla
--
Catalin
Powered by blists - more mailing lists