All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Weber <jweber@domain.hid>
To: Dmitry Adamushko <dmitry.adamushko@domain.hid>
Cc: Xenomai help <xenomai@xenomai.org>
Subject: Re: [Xenomai-help] isolating unwanted mode switch
Date: Tue, 23 Jan 2007 16:27:51 -0600	[thread overview]
Message-ID: <200701231627.51851.jweber@domain.hid> (raw)
In-Reply-To: <b647ffbd0701231345n33a7ecafm879ca25bdedab2fe@domain.hid>

Dimitry:

On Tuesday 23 January 2007 15:45, Dmitry Adamushko wrote:
> > Are there other events (not system calls) that initiate a switch to
> > secondary mode?
>
> exceptions (CPU exceptions, e.g. page faults). I presume, you have
> done mlockall(CURRENT | FUTURE), haven't you?
Yes.  my Linux application follows this this model:

main () {
	 mlockall(MCL_CURRENT | MCL_FUTURE);
	rt_task_shadow( ... )  // become a realtime thread

	// for N threads:
		rt_task_spawn( ... ) // fork off child RT thread
}

It is one of the child RT threads that encounters the SIGXCPU unwanted mode 
switch.  It this the correct way to call mlockall() ?

>
> As a starting point, take a look at what /proc/xenomai/faults provides.
Aha!  All faults are 0 expect for:
TRAP         CPU0
 ...
 14:          331    (Page fault)
...

So indeed I have an error in how I call mlockall().  (and I do error check the 
return value in main() ).

>
> Moreover, enable "Nucleus debugging support" in your kernel config. If
> it's an exception indeed, you would see a message like :
Will do.  I always stayed away from enabling XENO_OPT_DEBUG in the past 
because of the associated "scary" warning:
	"... Do not switch this option on unless you really know what you
        are doing."

While I was reconfiguring my kernel, I came across the related config:
XENO_OPT_DEBUG_QUEUES, which has even "scarier" warning:
	"... It adds even more runtime
        overhead then CONFIG_XENO_OPT_DEBUG, use with care."

Is the  XENO_OPT_DEBUG_QUEUES option safe and useful to enable too?

	thanks,
	Jeff


  reply	other threads:[~2007-01-23 22:27 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-23 20:48 [Xenomai-help] isolating unwanted mode switch Jeff Weber
2007-01-23 21:45 ` Dmitry Adamushko
2007-01-23 22:27   ` Jeff Weber [this message]
2007-01-24 10:08     ` Dmitry Adamushko
2007-01-24 11:22       ` [Xenomai-help] Patching latest Denx 2.4.25-devel kernel with xenomai-2.3.0 fails Daniel Schnell
2007-01-24 14:44         ` Wolfgang Grandegger
2007-01-24 17:04           ` Daniel Schnell
2007-01-24 21:33             ` Wolfgang Grandegger
2007-01-25  7:14               ` Wolfgang Grandegger
2007-01-25  9:03                 ` Daniel Schnell
2007-01-25  9:38                   ` Wolfgang Grandegger
2007-01-29 15:36                 ` Philippe Gerum
2007-01-24 17:52       ` [Xenomai-help] isolating unwanted mode switch Jeff Weber
2007-01-24 18:55         ` Eric Noulard
2007-01-25  7:30           ` M. Koehrer
2007-01-25  8:24             ` Eric Noulard
2007-01-25 10:50         ` Philippe Gerum
2007-01-25 17:04           ` Jeff Weber

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=200701231627.51851.jweber@domain.hid \
    --to=jweber@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.