From: Steven Rostedt <rostedt@goodmis.org>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: LKML <linux-kernel@vger.kernel.org>,
RT <linux-rt-users@vger.kernel.org>,
Clark Williams <clark@redhat.com>, John Kacur <jkacur@redhat.com>,
Carsten Emde <cbe@osadl.org>,
Peter Zijlstra <peterz@infradead.org>
Subject: Re: [PATCH RT] seqlock/rt: Prevent livelocks with seqlocks in RT
Date: Tue, 06 Mar 2012 07:17:37 -0500 [thread overview]
Message-ID: <1331036257.25686.365.camel@gandalf.stny.rr.com> (raw)
In-Reply-To: <alpine.LFD.2.02.1203060911000.2742@ionos>
On Tue, 2012-03-06 at 09:18 +0100, Thomas Gleixner wrote:
> Errm. rt15 has
>
> /*
> * Starvation safe read side for RT
> */
> static inline unsigned read_seqbegin(seqlock_t *sl)
> {
> unsigned ret;
>
> repeat:
> ret = sl->seqcount.sequence;
> if (unlikely(ret & 1)) {
> /*
> * Take the lock and let the writer proceed (i.e. evtl
> * boost it), otherwise we could loop here forever.
> */
> spin_lock(&sl->lock);
> spin_unlock(&sl->lock);
> goto repeat;
> }
> return ret;
> }
> #endif
You're right it does!
I didn't see this as the lock up showed it was locked up in
read_seqcount_begin(), it was late and I was tired.
Here's the real fix then:
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h
index 723274d..29ffd4f 100644
--- a/include/linux/seqlock.h
+++ b/include/linux/seqlock.h
@@ -177,7 +177,7 @@ typedef struct {
/*
* Read side functions for starting and finalizing a read side section.
*/
-#ifndef CONFIG_PREEMPT_RT
+#ifndef CONFIG_PREEMPT_RT_FULL
static inline unsigned read_seqbegin(const seqlock_t *sl)
{
return read_seqcount_begin(&sl->seqcount);
next prev parent reply other threads:[~2012-03-06 12:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-06 4:03 [PATCH RT] seqlock/rt: Prevent livelocks with seqlocks in RT Steven Rostedt
2012-03-06 8:18 ` Thomas Gleixner
2012-03-06 12:17 ` Steven Rostedt [this message]
2012-03-06 13:19 ` Thomas Gleixner
2012-03-06 12:47 ` Steven Rostedt
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=1331036257.25686.365.camel@gandalf.stny.rr.com \
--to=rostedt@goodmis.org \
--cc=cbe@osadl.org \
--cc=clark@redhat.com \
--cc=jkacur@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-users@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/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