From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Andreas Glatz <AndreasGlatz@domain.hid>
Cc: "xenomai@xenomai.org" <xenomai@xenomai.org>
Subject: Re: [Xenomai-help] Page fault and secondary mode switch on PowerPC
Date: Sat, 01 May 2010 18:37:01 +0200 [thread overview]
Message-ID: <4BDC58AD.2090400@domain.hid> (raw)
In-Reply-To: <4BDC57EB.3030106@domain.hid>
Gilles Chanteperdrix wrote:
> Andreas Glatz wrote:
>>>> We are running our tests now where Linux is bombarded with interrupts. Under certain conditions
>>>> we found that we get page faults in IRQ Tasks which cause a secondary mode switch. To my understanding
>>>> and what makes things worse is that, ISR tasks always run with the scheduler lock bit set (T_LOCK).
>>>> In our case this means that when we switch to the secondary mode from the ISR Task, all other Xenomai
>>>> tasks don't get scheduled until the ISR task returns to primary mode. Since Linux is under heavy
>>>> interrupt load, it takes about 1-2sec for any Xenomai task to start running again.
>>>>
>>>> I attached a LTTng trace where you can see whats going on. Here the short version:
>>> Could you tell us what version of Xenomai you are using?
>> Linux 2.6.32-5, Xenomai 2.4.10.1, Ipipe 2.8
>>
>>
>>> And if your program uses fork() (or anything which uses fork such as
>>> system(), or popen())?
>> Yes but all the real-time threads are created in the parent.
>> The children are just helper processes which don't make use of Xenomai APIs at all.
>
> It does not matter. When you call fork, the linux kernel sets up copy on
> write for most mappings such as the stacks in both the parent and the
> child. The I-pipe patch for other architectures sets up a (costly, so
> best avoided anyway) protection for this case but not on powerpc.
>
> If the helper processes are only needed at the beginning of the process
> life, you can fault all the mappings after the last fork (I have a piece
> of code which does that if you are interested).
>
> If the helper processes are created all along the life of your process
> you are out of luck. You will get faults. So, you are probably better
> handle these helpers in another process.
Another tip: if the reason why you fork is to call exec, then you are
much better of calling vfork.
--
Gilles.
next prev parent reply other threads:[~2010-05-01 16:37 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-30 23:34 [Xenomai-help] Page fault and secondary mode switch on PowerPC Andreas Glatz
2010-05-01 9:20 ` Gilles Chanteperdrix
2010-05-01 15:59 ` Andreas Glatz
2010-05-01 16:33 ` Gilles Chanteperdrix
2010-05-01 16:37 ` Gilles Chanteperdrix [this message]
2010-05-03 1:41 ` Andreas Glatz
2010-05-03 5:38 ` Gilles Chanteperdrix
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=4BDC58AD.2090400@domain.hid \
--to=gilles.chanteperdrix@xenomai.org \
--cc=AndreasGlatz@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.