From: Lai Jiangshan <laijs@cn.fujitsu.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
Thomas Gleixner <tglx@linutronix.de>,
Peter Zijlstra <peterz@infradead.org>
Subject: Re: [RFC][RT][PATCH 4/4] rtmutex: Ensure only the top waiter or higher priority task can take the lock
Date: Wed, 05 Jan 2011 15:12:00 +0800 [thread overview]
Message-ID: <4D2419C0.9010102@cn.fujitsu.com> (raw)
In-Reply-To: <1294113773.3948.203.camel@gandalf.stny.rr.com>
On 01/04/2011 12:02 PM, Steven Rostedt wrote:
> On Thu, 2010-12-23 at 17:47 -0500, Steven Rostedt wrote:
>> plain text document attachment
>> (0004-rtmutex-Ensure-only-the-top-waiter-or-higher-priorit.patch)
>> From: Lai Jiangshan <laijs@cn.fujitsu.com>
>>
>> In current rtmutex, the pending owner may be boosted by the tasks
>> in the rtmutex's waitlist when the pending owner is deboosted
>> or a task in the waitlist is boosted. This boosting is unrelated,
>> because the pending owner does not really take the rtmutex.
>> It is not reasonable.
>>
>
> I'm still hitting some bugs with the port to -rt, but I also noticed
> something that doesn't look too good.
>
> There's several places in the kernel where a task may release and
> acquire the same lock multiple times in a row.
>
> The old way of removing the pending owner from the lists and waking it
> up once, would have the high prio task wake it up once, and then it can
> grab the locks multiple times without modifying the list, since the
> pending owner is already awake and not in the pi list anymore.
>
> The new way has the owner remove the woken task from its pi list and
> wakes it up, but when it steals the lock again, it adds this owner back
> to its pi list. When it releases the lock, it wakes it up again and
> removes it from its pi list again. This happens over and over again.
It is a expected behavior. With this behavior: we can assume that
if a lock has waiter(s), the top waiter is always on the owner's pi list
and the owner gets/(will get) boosted from it.
This simplifies the code and the logic. But performance is more important,
I will send 2 patches for it in this weekend.
Thanks,
Lai.
prev parent reply other threads:[~2011-01-05 7:11 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-23 22:47 [RFC][RT][PATCH 0/4] rtmutex: Simplify PI code Steven Rostedt
2010-12-23 22:47 ` [RFC][RT][PATCH 1/4] rtmutex: Only save lock depth once in spin_slowlock Steven Rostedt
2010-12-23 22:47 ` [RFC][RT][PATCH 2/4] rtmutex: Try to take lock early in rt_spin_lock_slowlock() Steven Rostedt
2010-12-23 22:47 ` [RFC][RT][PATCH 3/4] rtmutex: Revert Optimize rt lock wakeup Steven Rostedt
2010-12-24 4:45 ` Gregory Haskins
2010-12-24 4:54 ` Steven Rostedt
2010-12-28 14:06 ` Gregory Haskins
2011-01-03 19:06 ` Steven Rostedt
2011-01-03 20:22 ` Steven Rostedt
2011-01-04 15:19 ` Peter W. Morreale
2011-01-04 15:47 ` Steven Rostedt
2011-01-04 17:15 ` Peter W. Morreale
2011-01-04 17:27 ` Steven Rostedt
2011-01-04 17:45 ` Peter W. Morreale
2011-01-04 18:06 ` Steven Rostedt
2011-01-04 20:48 ` Peter W. Morreale
2011-01-04 17:24 ` Peter W. Morreale
2011-01-10 14:49 ` Gregory Haskins
[not found] ` <4D13DF250200005A000793E1@novell.com>
2010-12-24 15:47 ` Peter W. Morreale
2010-12-23 22:47 ` [RFC][RT][PATCH 4/4] rtmutex: Ensure only the top waiter or higher priority task can take the lock Steven Rostedt
2011-01-04 4:02 ` Steven Rostedt
2011-01-05 7:12 ` Lai Jiangshan [this message]
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=4D2419C0.9010102@cn.fujitsu.com \
--to=laijs@cn.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=peterz@infradead.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