Re: Why can't my serial driver can't keep up?



On Tue, 27 Dec 2005 21:36:37 +0100, Kasper Dupont
<64459405747538527765@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

> "ryan.stowell@xxxxxxxxx" wrote:
>>
>> The problem is when data is missing I see a point where it took 345ms
>> to respond to the ISR. I know that Linux is not a RTOS but should it
>> ever take that long to respond to an interrupt?

That's a third of a second! The kernel should never disable interrupts
for that long. For one thing, he'll miss hundreds of timer ticks.


> Clearly that shouldn't be happening. Typical Linux systems handle
> timer interrupts every 1-10ms.

> If the kernel doesn't start servicing an IRQ within a few
> microseconds, they must be disabled somehow. They could be disabled in
> the CPU or in the IRQ controller.

Or somewhere in the BIOS SMI or ACPI code, if there is some sort of
power management activated. Also, things like "legacy USB" support in
the BIOS may result in SMI taking over the machine once in a while,
depending on how they're implemented. The RTAI folk have documented
some instances where the SMI/ACPI effect causes delays in the range of
tens of milliseconds every few seconds.

Could also be a priority thing. Is a higher-priority interrupt
preventing yours from being serviced? Is your interrup shared with any
other device that may not be working correctly if the IRQ is shared?

Just to point out that the problem may not be in the kernel.


>> What could the kernel be doing that would change the response time
>> from tens of microseconds to hundreds of milliseconds?
>
> The kernel does disable interrupts in certain critical parts
> of the code. But those shouldn't be spending lots of time.

Yeah, 345 ms is just ridiculous. Even the old problems with IDE masking
interrupts weren't that bad.


--
-| Bob Hauck
-| A proud member of the reality-based community.
-| http://www.haucks.org/
.



Relevant Pages

  • Re: [PATCH] Documentation: Make fujitsu/frv/kernel-ABI.txt 80 columns wide
    ... -The internal FRV kernel ABI is not quite the same as the userspace ABI. ... -most of them do not have any scratch registers, thus requiring at least one general purpose ... +single-stepping will blithely go on stepping into things like interrupts. ... -to read and once to write), we don't actually disable interrupts at all if we don't have to. ...
    (Linux-Kernel)
  • Re: Interrupt Service Routine (ISR) for Linux?
    ... I can use ISRs to communicate with hardwares. ... There are two uses for interrupts on DOS: ... > in Linux? ... which are part of the kernel code. ...
    (comp.os.linux.development.system)
  • Re: ntp client over satellite and no CMOS battery
    ... e.g. Windows and Linux do not do nearly so well. ... More recent versions of Linux have tended to have some kernel issues that require rebuilding with different options, if you want to be able to keep good time. ... It's when the system gets very busy for extended periods that the problem of lost clock interrupts shows up. ...
    (comp.protocols.time.ntp)
  • Timer Interrupts, please CC hamilton@sedsystems.ca
    ... We are using a custom modulator card with the Linux 2.2.16 kernel ... interrupts when almost empty). ... Can you tell me the frequency of timer interrupts used by the linux ...
    (Linux-Kernel)
  • Re: Timer Interrupts, please CC hamilton@sedsystems.ca
    ... > We are using a custom modulator card with the Linux 2.2.16 kernel ... > interrupts when almost empty). ... > Can you tell me the frequency of timer interrupts used by the linux ...
    (Linux-Kernel)