From: Bill Huey (hui) <bhuey@lnxw.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: dwalker@mvista.com, mingo@elte.hu, linux-kernel@vger.kernel.org,
"Perez-Gonzalez, Inaky" <inaky.perez-gonzalez@intel.com>,
Esben Nielsen <simlo@phys.au.dk>,
"Bill Huey (hui)" <bhuey@lnxw.com>
Subject: Re: FUSYN and RT
Date: Fri, 15 Apr 2005 15:51:37 -0700 [thread overview]
Message-ID: <20050415225137.GA23222@nietzsche.lynx.com> (raw)
In-Reply-To: <1113407200.4294.25.camel@localhost.localdomain>
On Wed, Apr 13, 2005 at 11:46:40AM -0400, Steven Rostedt wrote:
> On Tue, 2005-04-12 at 17:27 -0700, Daniel Walker wrote:
> > There is a great big snag in my assumptions. It's possible for a process
> > to hold a fusyn lock, then block on an RT lock. In that situation you
> > could have a high priority user space process be scheduled then block on
> > the same fusyn lock but the PI wouldn't be fully transitive , plus there
> > will be problems when the RT mutex tries to restore the priority.
> >
> > We could add simple hooks to force the RT mutex to fix up it's PI, but
> > it's not a long term solution.
Ok, I've been thinking about these issues and I believe there are a number
of misunderstandings here. The user and kernel space mutexes need to be
completely different implementations. I'll have more on this later.
First of all, priority transitivity should be discontinuous at the user/kernel
space boundary, but be propagated by the scheduler, via an API or hook,
upon a general priority boost to the thread in question.
You have thread A blocked in the kernel holding is onto userspace mutex 1a
and kernel mutex 2a. Thread A is priority boosted by a higher priority
thread B trying to acquire mutex 1a. The transitivity operation propagates
through the rest of the lock graph in userspace, via depth first search,
as usual. When it hits the last userspace mutex in question, this portion
of the propagation activity stops. Next, the scheduler itself finds out
that thread A has had it's priority altered because of a common priority
change API and starts another priority propagation operation in kernel
space to mutex 1b. There you have it. It's complete from user to kernel
space using a scheduler event/hook/api to propagate priority changes
into the kernel.
With all of that in place, you do a couple of things for the mutex
implementation. First, you convert as much code of the current RT mutex
code to be type polymorphic
as you can:
1) You use Daniel Walker's PI list handling for wait queue insertion for
both mutex implementation. This is done since it's already a library
and is already generic.
2) Then you generalize the dead lock detection code so that things like
"what to do in a deadlock case" is determine at the instantiation of
the code. You might have to use C preprocessor macros to do a generic
implementation and then fill in the parametric values for creating a
usable instance.
3) Make the grab owner code generic.
4) ...more part of the RT mutex...
etc...
> How hard would it be to use the RT mutex PI for the priority inheritance
> for fusyn? I only work with the RT mutex now and haven't looked at the
> fusyn. Maybe Ingo can make a separate PI system with its own API that
> both the fusyn and RT mutex can use. This way the fusyn locks can still
> be separate from the RT mutex locks but still work together.
I'd apply these implementation ideas across both mutexes, but keep the
individual mutexes functionality distinct. I look at this problem from
more of a reusability perspective than anything else.
> Basically can the fusyn work with the rt_mutex_waiter? That's what I
> would pull into its own subsystem. Have another structure that would
> reside in both the fusyn and RT mutex that would take over for the
> current rt_mutex that is used in pi_setprio and task_blocks_on_lock in
> rt.c. So if both locks used the same PI system, then this should all be
> cleared up.
Same thing...
There will be problems trying to implement a Posix read/write lock using
this method and the core RT mutex might have to be fundamentally altered
to handle recursion of some sort, decomposed into smaller bits and
recomposed into something else.
bill
next prev parent reply other threads:[~2005-04-15 22:53 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-12 20:35 FUSYN and RT Perez-Gonzalez, Inaky
2005-04-12 23:11 ` Esben Nielsen
2005-04-13 0:27 ` Daniel Walker
2005-04-13 15:46 ` Steven Rostedt
2005-04-13 17:33 ` Daniel Walker
2005-04-13 18:38 ` Steven Rostedt
2005-04-15 22:51 ` Bill Huey [this message]
2005-04-15 23:37 ` Inaky Perez-Gonzalez
2005-04-16 1:14 ` Steven Rostedt
2005-04-16 1:20 ` Inaky Perez-Gonzalez
2005-04-16 1:38 ` Steven Rostedt
2005-04-16 1:53 ` Inaky Perez-Gonzalez
2005-04-16 2:31 ` Steven Rostedt
2005-04-16 3:00 ` Sven Dietrich
2005-04-16 3:31 ` Steven Rostedt
2005-04-16 13:05 ` john cooper
2005-04-16 14:23 ` Steven Rostedt
2005-04-16 14:51 ` john cooper
2005-04-16 4:05 ` Inaky Perez-Gonzalez
2005-04-18 5:30 ` Bill Huey
2005-04-18 7:37 ` Sven-Thorsten Dietrich
2005-04-18 11:33 ` Steven Rostedt
-- strict thread matches above, loose matches on Subject: below --
2005-04-12 23:36 Perez-Gonzalez, Inaky
2005-04-12 23:09 Perez-Gonzalez, Inaky
2005-04-12 22:26 Perez-Gonzalez, Inaky
2005-04-12 22:33 ` Daniel Walker
2005-04-12 21:28 Perez-Gonzalez, Inaky
2005-04-12 19:35 Perez-Gonzalez, Inaky
2005-04-12 18:15 Daniel Walker
2005-04-12 20:29 ` Esben Nielsen
2005-04-12 22:15 ` Daniel Walker
2005-04-12 20:33 ` Joe Korty
2005-04-12 21:25 ` Daniel Walker
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=20050415225137.GA23222@nietzsche.lynx.com \
--to=bhuey@lnxw.com \
--cc=dwalker@mvista.com \
--cc=inaky.perez-gonzalez@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rostedt@goodmis.org \
--cc=simlo@phys.au.dk \
/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