Embedded Linux >> Kernel configuration problem? Waking up a thread from a hardware intterupt takes too long!

by kevin.hall » Sat, 02 Oct 2004 02:39:40 GMT

I am working on an embedded system that my company has developed. (My
company also developed the driver.) The problem we're seeing is that
on our embedded system it takes about 100 milliseconds (standard
deviation of 0.5 milliseconds so this is very consistent) to wake up a
thread that is waiting on a hardware interrupt.

However, running the same driver and executable (exact same binaries)
on a desktop (with different kernel configuration) only takes about
half a millisecond. We also ran tests on our embedded system with
other operating systems (embedded XP and VxWorks) and the delays take
no longer than 3 milliseconds, so we've been able to eliminate the
hardware.

We have also changed part of the kernel configuration and recompiled
the kernel. When we re-ran the tests with the new kernel, the delays
doubled to about 200 milliseconds. So we believe the problem is the
kernel configuration.

So my questions are: Has anyone had similar experiences? Does anyone
have any suggestions for what kernel configuration(s) might be the
culprit(s)?

Thank you for all your help!

- Kevin Hall


Embedded Linux >> Kernel configuration problem? Waking up a thread from a hardware intterupt takes too long!

by bitbucket » Wed, 06 Oct 2004 23:13:29 GMT


In article < XXXX@XXXXX.COM >,
XXXX@XXXXX.COM (Kevin Hall) writes:

What exactly did you change?


Some random ideas:

- Does your hardware share its interrupt with another device?

- From what you wrote, it seems you are measuring the time
between interrupt and *user thread* activation. If that is
the case, then you may also want to measure the time between
interrupt and *interrupt handler* invocation, so you can
decide wether those 100ms delays are caused by the interrupt
handling or by the user thread wakeup mechanism.

- How exactly does your user thread wait for the interrupt,
i.e. are you using sleep_on()?

- What else is going on in your system (i.e. disk/network activity)
while you run this test?

HTH

Rob

--
Robert Kaiser email: rkaiser AT sysgo DOT com
SYSGO AG http://www.elinos.com
Klein-Winternheim / Germany http://www.sysgo.com



Embedded Linux >> Kernel configuration problem? Waking up a thread from a hardware intterupt takes too long!

by Dan Kegel » Thu, 14 Oct 2004 13:47:45 GMT




What is CONFIG_HZ on the two systems?
(That setting was added in
http://www.kernel.org/pub/linux/kernel/people/rml/variable-HZ/v2.4/variable-hz-rml-2.4.20-pre10-ac2-1.patch )
Newer systems use 1000, older systems used 100, I think.
This might explain part of the problem?
- Dan


Similar Threads

1. [patch 09/32] JFS: Fix race waking up jfsIO kernel thread - Linux

2. [patch 64/69] JFS: Fix race waking up jfsIO kernel thread

3. [PATCH -stable] JFS: Fix race waking up jfsIO kernel thread - Linux

4. PROBLEM: close(fd) doesn't wake up read(fd) or select() in another thread

5. PROBLEM: close(fd) doesn't wake up read(fd) or select() in another thread - Linux

6. GDB waking up threads in a multi-threaded application

Hi,

I really hope I have the correct newsgroup here, and if not I
apologise in advance.

I'm writing some multi-threaded code here for a client/server
application and I had to use a read/write lock to achieve
concurrency.  When I left the application running over-night it hung
the next day.

So I started up GDB and attached to the client and then the server
examining the threads present in each and the back-trace of each
thread to get a better idea of where the hang occurred.  After
detaching GDB from the server the deadlock/hang went away and the
application started working again.

Has anyone ever seen something like this occur before?

Thanks,
Keith

7. Order of wake-ups from sleep queue

8. New wake ups from sky2