From: Thomas Gleixner <tglx@linutronix.de>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Lai Jiangshan <laijs@cn.fujitsu.com>, Ingo Molnar <mingo@elte.hu>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Andrew Morton <akpm@linux-foundation.org>,
Dave Young <hidave.darkstar@gmail.com>,
Darren Hart <dvhart@linux.intel.com>,
Namhyung Kim <namhyung@gmail.com>,
LKML <linux-kernel@vger.kernel.org>,
Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH] rtmutex: multiple candidate owners without unrelated boosting
Date: Wed, 15 Dec 2010 15:16:28 +0100 (CET) [thread overview]
Message-ID: <alpine.LFD.2.00.1012151515230.12146@localhost6.localdomain6> (raw)
In-Reply-To: <1292421766.5015.1866.camel@gandalf.stny.rr.com>
On Wed, 15 Dec 2010, Steven Rostedt wrote:
> On Wed, 2010-12-15 at 09:02 +0100, Thomas Gleixner wrote:
> > On Tue, 14 Dec 2010, Steven Rostedt wrote:
> >
> > > On Tue, 2010-12-14 at 17:04 +0800, Lai Jiangshan wrote:
> > >
> > > OK, I was looking at this in a bit more detail (the coffee finally set
> > > in) and I was at first looking to nuke the cand_owner since it is
> > > redundant to cand_seq. But I think we can nuke the cand_seq instead and
> > > use the top_waiter as the decider.
> >
> > So you just use cand_owner (the name sucks) to flag that the waiter
> > has been woken up either by the boost code or by an unlock. The waiter
> > clears that flag with waiter->lock->wait_lock held before calling
> > schedule().
> >
> > Though I think we do need it at all. wakeup of an already running task
> > is almost a nop, so having one less state to worry about is good.
>
> I was hoping to remove it completely, and yes I was hoping we could
> because a wakeup of a woken task is almost a nop. But then I saw this in
> rt_mutex_adjust_prio_chain():
>
>
> > /*
> > * Check the orig_waiter state. After we dropped the locks,
> > * the previous owner of the lock might have released the lock
> > - * and made us the pending owner:
> > + * and made us candidate owner:
> > */
> > - if (orig_waiter && !orig_waiter->task)
> > + if (orig_waiter && orig_waiter->cand_owner)
> > goto out_unlock_pi;
> >
>
> I'm not sure what else we could use to check if the original waiter has
> been given the lock.
That does not matter. The interesting part is whether the lock on
which orig_waiter is blocked on was unlocked. Lai's follow up patch does:
+ if (orig_waiter && !rt_mutex_owner(orig_lock))
goto out_unlock_pi;
Thanks,
tglx
next prev parent reply other threads:[~2010-12-15 14:16 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-14 9:04 Lai Jiangshan
2010-12-14 14:01 ` Steven Rostedt
2010-12-14 16:44 ` Lai Jiangshan
2010-12-14 17:00 ` Steven Rostedt
2010-12-15 4:25 ` Lai Jiangshan
2010-12-14 20:07 ` Thomas Gleixner
2010-12-15 3:41 ` Lai Jiangshan
2010-12-15 4:16 ` Steven Rostedt
2010-12-15 8:09 ` [PATCH] rtmutex: ensure only the top waiter or higher priority task can take the lock and reduce " Lai Jiangshan
2010-12-15 12:07 ` Thomas Gleixner
2010-12-15 14:24 ` Lai Jiangshan
2010-12-15 14:52 ` Thomas Gleixner
2010-12-15 15:01 ` Steven Rostedt
2010-12-16 20:33 ` Darren Hart
2010-12-17 3:10 ` Lai Jiangshan
2010-12-17 3:17 ` Steven Rostedt
2010-12-17 3:30 ` Steven Rostedt
2010-12-15 15:04 ` Steven Rostedt
2010-12-23 9:07 ` Lai Jiangshan
2010-12-23 12:56 ` Steven Rostedt
2010-12-15 21:53 ` Steven Rostedt
2010-12-16 1:14 ` Lai Jiangshan
2010-12-16 13:56 ` Steven Rostedt
2010-12-16 14:07 ` Steven Rostedt
2011-01-06 14:50 ` Steven Rostedt
2011-01-10 11:37 ` Lai Jiangshan
2011-01-10 12:57 ` Steven Rostedt
2010-12-23 8:49 ` [PATCH V3] rtmutex: ensure only the top waiter or higher priority task can take the lock and remove " Lai Jiangshan
2011-01-12 17:03 ` Steven Rostedt
2011-01-12 17:04 ` Steven Rostedt
2011-01-12 17:05 ` Steven Rostedt
2011-01-14 9:09 ` [PATCH V4] " Lai Jiangshan
2011-01-21 17:34 ` Thomas Gleixner
2011-01-22 14:07 ` Steven Rostedt
2011-01-22 14:09 ` Steven Rostedt
2011-01-31 14:30 ` [tip:core/locking] rtmutex: Simplify PI algorithm and make highest prio task get lock tip-bot for Lai Jiangshan
2010-12-15 7:47 ` [PATCH] rtmutex: multiple candidate owners without unrelated boosting Thomas Gleixner
2010-12-16 20:55 ` Darren Hart
2010-12-23 7:25 ` Lai Jiangshan
2010-12-14 23:16 ` Steven Rostedt
2010-12-15 2:18 ` Steven Rostedt
2010-12-15 8:02 ` Thomas Gleixner
2010-12-15 14:02 ` Steven Rostedt
2010-12-15 14:16 ` Thomas Gleixner [this message]
2010-12-15 14:32 ` Steven Rostedt
2010-12-15 14:50 ` Thomas Gleixner
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=alpine.LFD.2.00.1012151515230.12146@localhost6.localdomain6 \
--to=tglx@linutronix.de \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=dvhart@linux.intel.com \
--cc=hidave.darkstar@gmail.com \
--cc=laijs@cn.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=namhyung@gmail.com \
--cc=rostedt@goodmis.org \
--cc=torvalds@linux-foundation.org \
/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
all inboxes | Powered by JetHome®