All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe Gerum <rpm@xenomai.org>
To: Jan Kiszka <jan.kiszka@domain.hid>
Cc: xenomai-core <xenomai@xenomai.org>
Subject: Re: [Xenomai-core] xnshadow_relax in taskexit_event
Date: Sun, 08 Mar 2009 12:03:58 +0100	[thread overview]
Message-ID: <49B3A61E.3040306@domain.hid> (raw)
In-Reply-To: <49B39DB5.8040601@domain.hid>

Jan Kiszka wrote:
> Hi,
> 
> this looks suspicious to me:
> 
> static inline void do_taskexit_event(struct task_struct *p)
> {
> 	...
> 	if (xnpod_shadow_p())
> 		xnshadow_relax(0);
> 
> A) The only call context of this hook is do_exit() - and that's Linux
> kernel code which should always run in secondary mode, no?
>

It is a left-over from the days when do_exit() could be called from primary 
context directly on behalf on the shadow unmapping code; now we go through an 
APC, so that should be ok.

> B) Even if we were called once in a while from primary mode here, too,
> the check xnpod_shadow_p() would only tell us that we are a shadow
> thread, not in which mode we currently run.
> 

Nak, this test is fine, even if probably useless now. xnpod_shadow_p() 
implicitely checks that your current Xenomai thread is not in secondary mode, 
because you cannot find the XNSHADOW bit set in the root thread tcb, which must 
be active in secondary mode.

> I've tested a removal of this hunk and found no regressions so far. Will
> post a patch unless someone can explain why we actually need this (and
> why A) and B) are non-issues).

Let's replace this code with a BUG_ON(xnpod_shadow_p()).

> 
> Jan
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Xenomai-core mailing list
> Xenomai-core@domain.hid
> https://mail.gna.org/listinfo/xenomai-core



  reply	other threads:[~2009-03-08 11:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-08 10:28 [Xenomai-core] xnshadow_relax in taskexit_event Jan Kiszka
2009-03-08 11:03 ` Philippe Gerum [this message]
2009-03-09  9:19   ` Jan Kiszka
2009-03-09  9:32     ` Philippe Gerum
2009-03-09  9:39       ` Jan Kiszka
2009-03-09 10:16         ` Philippe Gerum

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=49B3A61E.3040306@domain.hid \
    --to=rpm@xenomai.org \
    --cc=jan.kiszka@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.