From: Matias Sundman <linux@sundmangroup.com>
To: Scott Wood <scottwood@freescale.com>,
"Arnon Kaufman(Work)" <arnon.work@gmail.com>
Cc: "linuxppc-embedded@ozlabs.org" <linuxppc-embedded@ozlabs.org>
Subject: Re: SCHED_FIFO & System()
Date: Fri, 18 Jan 2008 07:38:53 +0100 [thread overview]
Message-ID: <4790497D.3090004@sundmangroup.com> (raw)
In-Reply-To: <478FD3B7.2030105@freescale.com>
Hello,
/>>Are you running a preemptible kernel? [Scott]/
Yes the Kernel is configured as - Preemptible Kernel (Low-Latency Desktop)
/>>//what you actually need is a better kernel preemption such as using
Ingo Molnar 's PREEMPT_RT patch. (it may reduce performance a little)
[Arnon]
/
Ok - we can try to enable the PREEMPT_RT patches.
-------------------------------
I also tried with a sched_yield() before the call to system() in order
to see if the behavior changed somewhat but it didn't.
Cheers // Matias :-)
Scott Wood skrev:
> Matias Sundman wrote:
>
>> Hello,
>> I have some strange behavior in one of my systems.
>>
>> I have a real-time thread under SCHED_FIFO which is running every 10ms.
>> It is blocking on a semaphore and released by a timer interrupt every 10ms.
>> Generally this works really well.
>>
>> However, there is a module in the system that makes a / system() / call
>> from c-code ;
>>
>> system("run_my_script");
>>
>> By calling and running a bash script. Independent of how the actual
>> script looks like the real time thread does not get scheduled under 80ms
>> -- the time it takes
>> for the system() call to finish.
>>
>
> Are you running a preemptible kernel?
>
> -Scott
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>
[From : Arnon Kaufman(Work) <arnon.work@gmail.com>]
I've seen this kind of behavior. i may guess that you configure the
kernel with PREEMPT, assuming it will solve the problem for you.
I'll split the problem into two:
1. program loading stage is finished (+ reschedule)
2. thread execution time (delay)
when executing a new application it's involved with plenty of kernel
activity such as fetching the application from storage, loader
relocation,allocating and remapping pages, resolving dynamic linking
etc..., all the activity occurs under the hood of the kernel, suspending
most of the kernel activities, due to many spin locks on the way. that
delays other kernel threads as well, and even workqueues.
trying to bypass the symptom - re-running the exact external
application , should not be involved with a second delay, as it was
cached. so may be running the external application in advance may be
good enough for you.
what you actually need is a better kernel preemption such as using Ingo
Molnar 's PREEMPT_RT patch. (it may reduce performance a little).
the second part is that the scheduler delays the thread execution as it
think other kernel's entities has a higher priority such as softirqs,
workqueue, etc...
the PREEMPT_RT may solve this problem as well as it bring a better
priority control, with the addition of priority inheritance.
next prev parent reply other threads:[~2008-01-18 6:39 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-17 7:01 SCHED_FIFO & System() Matias Sundman
2008-01-17 22:16 ` Scott Wood
2008-01-18 6:38 ` Matias Sundman [this message]
-- strict thread matches above, loose matches on Subject: below --
2008-01-17 10:19 SCHED_FIFO & system() linux
2008-01-18 6:41 ` Matias Sundman
2008-01-18 13:16 ` Gregory Haskins
2008-01-18 13:31 ` Gregory Haskins
2008-01-18 16:37 ` Steven Rostedt
2008-01-17 22:14 SCHED_FIFO & System() Arnon Kaufman(Work)
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=4790497D.3090004@sundmangroup.com \
--to=linux@sundmangroup.com \
--cc=arnon.work@gmail.com \
--cc=linuxppc-embedded@ozlabs.org \
--cc=scottwood@freescale.com \
/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.