lkml.org 
[lkml]   [2012]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [PATCH RT] seqlock/rt: Prevent livelocks with seqlocks in RT
From
Date
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);



\
 
 \ /
  Last update: 2012-03-06 13:19    [W:1.002 / U:0.376 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site