All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <kiszka@domain.hid>
To: Dmitry Adamushko <dmitry.adamushko@domain.hid>
Cc: xenomai-core <xenomai@xenomai.org>
Subject: Re: [Xenomai-core] Question about shadow migration
Date: Wed, 16 Nov 2005 10:33:43 +0100	[thread overview]
Message-ID: <437AFCF7.7000304@domain.hid> (raw)
In-Reply-To: <OF5FF1274A.4919E255-ONC12570BB.002EA267-C12570BB.00331586@domain.hid>

[-- Attachment #1: Type: text/plain, Size: 3610 bytes --]

Dmitry Adamushko wrote:
> 
> xenomai-core-bounces@domain.hid wrote on 16.11.2005 09:09:07:
> 
>> The question for me is now if I got these details right: first a
>> migration request is issued [1] but not immediately executed,
> 
> This request is about scheduling an APC for execution (which is lostage_apc
> in that case). The APC mechanism is implemented on top of the VIRQ
> mechanism so when Linux gets control back it has a pending VIRQ that will
> be executed at the first appropriate point. It's not immediately actually
> since the Linux domain could have been preempted last time at some point
> with the interrupts off.
> The VIRQ handler, in turn, wakes up a desired process (i.e. puts it in the
> linux's runqueue) so it can be run again at the next preempteble point.
> Sure, there can be other runnable processes with higher prios.
> 
>> then the
>> priority of the root thread (Linux) is lifted to the one of the shadow
>> thread [2]
> 
> Yes, in order to prevent other rt activities with lower rt prios from
> preempting a soon-to-be-relaxed thread while it's going to be run in the
> secondary mode. So it's about keeping the sole priority scheme across
> domains (classical RTAI does the opposite to my knowledge).
> 
>> , and then the shadow thread is suspend with respect to the
>> xenomai scheduler [3]. The last step should let the Linux kernel start
>> over again, run to its next preemption point (and this is the region
>> where non-deterministic delays may be injected with current kernels,
>> isn't it?),
> 
> Yes, there are 2 points:
> 
> - a time between a moment when the Linux domain gets control back and the
> moment when VIRQ->APC->lostage_handler may be executed (*);
> 
> e.g. the Linux domain could have been preempted last time at some point
> with the interrupts off so we are dependent on the lenght of irq-off
> sections in the linux kernel.
> 
> - a time between (*) and the next preemption point when a newly awakenen
> task may get control back.
> 
> e.g. other asynch. activities have been previously scheduled in the linux
> domain (pending interrupts, bottom halves).
> 
> The IRQ shield (if used) protects only from the asynch. activities that may
> occur when a rt task is already executing in the linux domain, not from
> those that were scheduled for execution before the rt task has entered the
> linux domain.
> 
> 
>> and switch over to lostage_handler() [4] to resume the Linux
>> part of the shadow thread. After that the execution of the shadow, now
>> in secondary mode, continues in xnshadow_relax() after [3]. Am I right?
> 
> Yes, Actually, another interesting point here is rthal_reenter_root().
> It's about properly (re-)adjusting a priority of the linux thread if the
> shadow counterpart has changed its priority while running in the primary
> domain. The linux thread is executing with its old priority between L543
> and L551. So it's a small priority-related flaw regarding the migration
> scheme. The reason is that it's not possible (likely it's possible with
> linux versions >= 2.6.13) to properly change the priority of the linux task
> on top of VIRQs (ISR handlers). Once we have discussed it with Philippe and
> there can be another solution though. But we decided to wait a bit until
> all the dust with scheduler-related changes in 2.6.x settles down.
> 
> Hopefully, I haven't misled you too much with my comments :o)
> 

No, I actually got it :). I'm preparing a presentation about Xenomai,
and now I can even boast a bit more with details. ;)

Jan



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]

      reply	other threads:[~2005-11-16  9:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-16  8:09 [Xenomai-core] Question about shadow migration Jan Kiszka
2005-11-16  9:17 ` Dmitry Adamushko
2005-11-16  9:33   ` Jan Kiszka [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=437AFCF7.7000304@domain.hid \
    --to=kiszka@domain.hid \
    --cc=dmitry.adamushko@domain.hid \
    --cc=xenomai@xenomai.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.