From: Peter Zijlstra <peterz@infradead.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
LKML <linux-kernel@vger.kernel.org>,
linux-rt-users <linux-rt-users@vger.kernel.org>
Subject: Re: [ANNOUNCE] 3.2.9-rt17
Date: Thu, 08 Mar 2012 22:20:27 +0100 [thread overview]
Message-ID: <1331241627.11248.430.camel@twins> (raw)
In-Reply-To: <1331240882.25686.499.camel@gandalf.stny.rr.com>
On Thu, 2012-03-08 at 16:08 -0500, Steven Rostedt wrote:
> Hmm, perhaps we need a way to attach a priority to a lock. Maybe we just
> need a way to set a priority of a lock with.. "A task of priority X
> needs the lock, set the owner to at least X while it holds the lock",
> where it doesn't care about the high priority task, it just cares about
> the lock. That is, give locks a priority too (like priority ceiling). On
> doing spin_trylock_rt() (no need for deadlock detection) if it fails,
> gives a lock the priority of the task trying to take it. The lock will
> be given a temporary priority for the duration it is held. The owner of
> the lock will get that priority unless its already higher in priority.
> When the lock is released, both the owner and the lock lose the
> priority.
>
> Note, spin_trylock_rt() continues to run even on failure.
>
> Have cpu_chill() do a "sched_yield()" (the good kind, to put the current
> FIFO task behind another FIFO task of the same priority). Then the owner
> of the lock will get to run.
>
> The sched_yield in cpu_chill() would be needed if the owner of the lock
> is blocked on the lock the high priority task has. After the high
> priority task releases its lock, and calls cpu_chill(), the
> sched_yield() allows the owner of the lock to run if it happens to be
> blocked on the lock the high prio task held. As the cpu_chill() will be
> called after that lock is released.
Now put the thing on 2 cpus and both tasks can endlessly chase each
other's tail, no? The yield will be useless there..
next prev parent reply other threads:[~2012-03-08 21:20 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-07 21:49 [ANNOUNCE] 3.2.9-rt17 Thomas Gleixner
2012-03-08 18:23 ` Steven Rostedt
2012-03-08 18:28 ` Peter Zijlstra
2012-03-08 18:42 ` Steven Rostedt
2012-03-08 19:39 ` Peter Zijlstra
2012-03-08 20:10 ` Steven Rostedt
2012-03-08 20:26 ` Peter Zijlstra
2012-03-08 21:08 ` Steven Rostedt
2012-03-08 21:20 ` Peter Zijlstra [this message]
2012-03-08 21:25 ` Steven Rostedt
2012-03-08 21:28 ` Peter Zijlstra
2012-03-08 21:36 ` Steven Rostedt
2012-03-08 21:37 ` Peter Zijlstra
2012-03-08 21:44 ` Steven Rostedt
2012-03-08 21:54 ` Peter Zijlstra
2012-03-08 22:13 ` Steven Rostedt
2012-03-08 22:20 ` Peter Zijlstra
2012-03-08 22:27 ` Steven Rostedt
2012-03-09 4:17 ` Steven Rostedt
2012-03-09 0:33 ` Thomas Gleixner
2012-03-09 3:08 ` Steven Rostedt
2012-03-09 0:20 ` Thomas Gleixner
2012-03-09 2:50 ` Steven Rostedt
2012-03-09 10:23 ` Thomas Gleixner
2012-03-09 12:51 ` Steven Rostedt
2012-03-08 19:48 ` Peter Zijlstra
2012-03-08 20:01 ` Steven Rostedt
2012-03-08 20:08 ` Peter Zijlstra
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=1331241627.11248.430.camel@twins \
--to=peterz@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-users@vger.kernel.org \
--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 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).