mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Esben Nielsen <nielsen.esben@googlemail.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Esben Nielsen <nielsen.esben@googlemail.com>,
	Ingo Molnar <mingo@elte.hu>,
	linux-kernel@vger.kernel.org
Subject: Re: Why can't I set the priority of softirq-hrt? (Re: 2.6.17-rt1)
Date: Wed, 21 Jun 2006 00:19:59 +0100 (BST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0606202344240.11643@localhost.localdomain> (raw)
In-Reply-To: <1150835732.6780.293.camel@localhost.localdomain>

On Tue, 20 Jun 2006, Thomas Gleixner wrote:

> On Tue, 2006-06-20 at 22:16 +0100, Esben Nielsen wrote:
>>> We had this before and it is horrible.
>>
>> "Horrible" in what respect?
>
> Unbound latencies.
>
>>> A nice solution would be to enqueue the timer into the task struct of
>>> the thread which is target of the signal, wake that thread in a special
>>> state which only runs the callback and then does the signal delivery.
>>
>> What if the thread is running?
>
> Well, do it in the return from interrupt path.

Wouldn't it just be the same as interrupt context then?

>
>> Hmm, a practical thing to do would be to make a system where you can post
>> jobs in a thread. These jobs can then be done in thread context
>> around schedule or just before the task returns to user-space.
>
> Thats basically what I said. But you have to take care of asynchronous
> signal delivery. Therefor you need a special state. Also return to
> userspace is not enough. You have to do the check in the return from
> interrupt path, as you might delay async signals otherwise.
>

It doesn't sound very preemptible then.

I was more thinking along the lines of having a "message" where threads 
(and interrupts) can post functions to each other to be executed in 
the target context.

The idea is:
1) You can get a fairly standeard code executeded with a priority 
associated with the target thread.
2) Make sure that only one thread touches some data and that way avoid 
having locks and therefore deadlocks.
3) Simplyfying callbacks. Instead of installing a callback which can be 
executed in some task or interrupt, you can with this system make a 
callback which will be executed in client's context, and thus simplyfying 
the client's headaches with locks.

By "fairly standeard" code I mean code which doesn't block 
except that it should be allowed to use mutexes, which in many ways is not 
real blocking when PI is implemented.

If this should be safe you can't just preemp and execute these functions 
anywhere in a thread. It must be in a well-defined place where no mutexes are 
held. Many (all?) kernel threads have a while() with a central schedule() in
the middle. One can most often call these functions safely at this 
schedule(). For userspace threads it would also be safe to call the functions
when going in and out of userspace. It will probably be safe to call the
functions at any call to schedule() except for the one inside the mutex 
lock operation. The volentary-preemption points Ingo made some years ago 
would probably be ok places, too.

Esben

> 	tglx
>
>

  reply	other threads:[~2006-06-20 22:19 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-18  7:06 2.6.17-rt1 Ingo Molnar
2006-06-18 16:13 ` 2.6.17-rt1 Michal Piotrowski
     [not found] ` <Pine.LNX.4.64.0606201656230.11643@localhost.localdomain>
2006-06-20 15:13   ` Why can't I set the priority of softirq-hrt? (Re: 2.6.17-rt1) Thomas Gleixner
2006-06-20 17:09     ` Esben Nielsen
2006-06-20 16:35       ` Thomas Gleixner
2006-06-20 21:16         ` Esben Nielsen
2006-06-20 20:35           ` Thomas Gleixner
2006-06-20 23:19             ` Esben Nielsen [this message]
2006-06-20 16:39       ` Steven Rostedt
2006-06-20 18:12         ` Esben Nielsen
2006-06-20 17:21           ` Thomas Gleixner
2006-06-20 21:26             ` Esben Nielsen
2006-06-20 20:51               ` Thomas Gleixner
2006-06-21  8:20               ` Steven Rostedt
2006-06-21 11:05                 ` Esben Nielsen
2006-06-21 15:43                   ` Esben Nielsen
2006-06-21 15:21                     ` Steven Rostedt
2006-06-21 16:37                       ` Esben Nielsen
2006-06-21 15:51                         ` Steven Rostedt
2006-06-21 17:14                           ` Esben Nielsen
2006-06-21 16:26                     ` Thomas Gleixner
2006-06-21 18:30                       ` Ingo Molnar
2006-06-22 10:28                         ` Esben Nielsen
2006-06-21 21:29                       ` Esben Nielsen
2006-06-21 20:33                         ` Thomas Gleixner
2006-06-21 23:35                           ` Esben Nielsen
2006-06-22  7:06                             ` Thomas Gleixner
2006-06-22 10:32                               ` Esben Nielsen
2006-06-22 13:33                               ` Steven Rostedt
2006-06-22 13:45                       ` Steven Rostedt
2006-06-22 14:20                         ` Thomas Gleixner
2006-06-22 14:23                           ` Steven Rostedt
2006-06-22 14:26                             ` Thomas Gleixner
2006-06-22 18:06                               ` Esben Nielsen
2006-06-22 18:05                                 ` Thomas Gleixner
2006-06-23 11:23                                   ` Esben Nielsen
2006-06-23 11:06                                     ` Steven Rostedt
2006-07-03 11:48                                     ` Esben Nielsen
2006-06-21  8:13           ` Steven Rostedt
2006-06-21 11:03             ` Esben Nielsen
2006-06-22  0:57 ` 2.6.17-rt1 Lee Revell
2006-06-22  2:51   ` More weird latency trace output (was Re: 2.6.17-rt1) Lee Revell
2006-06-23  1:24     ` Lee Revell
2006-06-24 22:15       ` Lee Revell
2006-06-24 22:12         ` Ingo Molnar
2006-06-24 22:31           ` Lee Revell
2006-06-24 23:49           ` Lee Revell
2006-06-23 20:56 ` 2.6.17-rt1 - mm_struct leak Vernon Mauery
2006-06-24  9:24   ` Mark Hounschell
2006-06-24  9:32     ` Mark Hounschell
2006-06-30 16:02   ` [PATCH -RT]Re: " Vernon Mauery

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=Pine.LNX.4.64.0606202344240.11643@localhost.localdomain \
    --to=nielsen.esben@googlemail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --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

all inboxes | Powered by JetHome®