All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Galbraith <bitbucket@online.de>
To: Manfred Spraul <manfred@colorfullife.com>
Cc: linux-rt-users <linux-rt-users@vger.kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: Re: [patch 1/3] ipc/sem: fix -rt livelock
Date: Sun, 15 Sep 2013 06:45:40 +0200	[thread overview]
Message-ID: <1379220340.5545.93.camel@marge.simpson.net> (raw)
In-Reply-To: <5234D94D.8010608@colorfullife.com>

On Sat, 2013-09-14 at 23:46 +0200, Manfred Spraul wrote: 
> Hi Mike,
> 
> On 09/13/2013 08:12 AM, Mike Galbraith wrote:
> > goto again loop can and does induce livelock in -rt.  Remove it.
> >
> > spin_unlock_wait(lock) in -rt kernels takes/releases the lock in question, so
> > all it takes to create a self perpetuating loop is for one task to start the
> > ball rolling by taking the array lock, other tasks see this, and react by
> > take/release/retry endlessly.
> I think your code inherits the race I just sent to you:
> The test of complex_count must be after spin_is_locked().
> 
> http://marc.info/?l=linux-kernel&m=137919453307294
> 
> Could you check that?

I think you're right.

> Or alternatively: Is my proposed sem_lock() function -rt friendly?

Some way of making spin_unlock_wait() _go away_ along with the livelock
would be better, but patches look good to me.  I'll apply both and stare
at the sum, and ask boxen what they think.. they're better at spotting
locking troubles ;-)

-Mike


  reply	other threads:[~2013-09-15  4:45 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1379051751.5455.112.camel@marge.simpson.net>
2013-09-13  6:12 ` [patch 1/3] ipc/sem: fix -rt livelock Mike Galbraith
2013-09-14 12:24   ` Manfred Spraul
2013-09-15  3:41     ` Mike Galbraith
2013-09-14 21:46   ` Manfred Spraul
2013-09-15  4:45     ` Mike Galbraith [this message]
2013-10-04 10:44       ` Sebastian Andrzej Siewior
2013-10-04 11:16         ` Mike Galbraith
2013-10-04 11:28           ` Sebastian Andrzej Siewior
2013-10-04 13:55             ` Mike Galbraith
2013-10-04 14:02               ` Manfred Spraul
2013-10-04 14:08                 ` Mike Galbraith
2013-10-11 15:36                   ` Sebastian Andrzej Siewior
2013-10-12  4:34                     ` Mike Galbraith
2013-09-13  6:12 ` [patch 2/3] ipc/sem: revert ipc/sem: Rework semaphore wakeups Mike Galbraith
2013-09-13  6:12 ` [patch 3/3] ipc/sem: Add -RT compatible wakeup scheme Mike Galbraith

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=1379220340.5545.93.camel@marge.simpson.net \
    --to=bitbucket@online.de \
    --cc=a.p.zijlstra@chello.nl \
    --cc=bigeasy@linutronix.de \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=manfred@colorfullife.com \
    --cc=rostedt@goodmis.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.