From: Steven Rostedt <rostedt@goodmis.org>
To: Catalin Marinas <catalin.marinas@arm.com>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Andrea Parri <andrea.parri@amarulasolutions.com>,
Peter Zijlstra <peterz@infradead.org>,
zhe.he@windriver.com, tglx@linutronix.de, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org,
boqun.feng@gmail.com
Subject: Re: [PATCH v2] kmemleak: Turn kmemleak_lock to raw spinlock on RT
Date: Fri, 23 Nov 2018 10:51:32 -0500 [thread overview]
Message-ID: <20181123105132.47ee57ad@vmware.local.home> (raw)
In-Reply-To: <20181123113130.GA3360@arrakis.emea.arm.com>
On Fri, 23 Nov 2018 11:31:31 +0000
Catalin Marinas <catalin.marinas@arm.com> wrote:
> 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
>
And the code appears to confirm it too:
void queued_read_lock_slowpath(struct qrwlock *lock)
{
/*
* Readers come here when they cannot get the lock without waiting
*/
if (unlikely(in_interrupt())) {
/*
* Readers in interrupt context will get the lock immediately
* if the writer is just waiting (not holding the lock yet),
* so spin with ACQUIRE semantics until the lock is available
* without waiting in the queue.
*/
atomic_cond_read_acquire(&lock->cnts, !(VAL & _QW_LOCKED));
return;
}
atomic_sub(_QR_BIAS, &lock->cnts);
/*
* Put the reader into the wait queue
*/
arch_spin_lock(&lock->wait_lock);
atomic_add(_QR_BIAS, &lock->cnts);
-- Steve
next prev parent reply other threads:[~2018-11-23 15:51 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-22 9:04 [PATCH v2] kmemleak: Turn kmemleak_lock to raw spinlock on RT zhe.he
2018-11-22 10:16 ` Sebastian Andrzej Siewior
2018-11-23 9:53 ` Sebastian Andrzej Siewior
2018-11-23 11:02 ` Andrea Parri
2018-11-23 11:06 ` Sebastian Andrzej Siewior
2018-11-23 11:31 ` Catalin Marinas
2018-11-23 15:51 ` Steven Rostedt [this message]
2018-11-26 8:40 ` Peter Zijlstra
2018-11-24 14:26 ` He Zhe
2018-11-30 18:19 ` Sebastian Andrzej Siewior
2018-12-05 13:53 ` He Zhe
2018-12-05 19:14 ` Sebastian Andrzej Siewior
2018-12-18 10:51 ` He Zhe
2018-12-18 15:07 ` Catalin Marinas
2018-12-19 15:30 ` Sebastian Andrzej Siewior
2018-12-20 1:46 ` He Zhe
2018-12-18 15:12 ` Catalin Marinas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181123105132.47ee57ad@vmware.local.home \
--to=rostedt@goodmis.org \
--cc=andrea.parri@amarulasolutions.com \
--cc=bigeasy@linutronix.de \
--cc=boqun.feng@gmail.com \
--cc=catalin.marinas@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-rt-users@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=zhe.he@windriver.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).