From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <4808C5E4.2000603@domain.hid> Date: Fri, 18 Apr 2008 18:01:40 +0200 From: Wolfgang Grandegger MIME-Version: 1.0 References: <2ff1a98a0804180748o4dc88c91of90e8e26c36d32ed@domain.hid> In-Reply-To: <2ff1a98a0804180748o4dc88c91of90e8e26c36d32ed@domain.hid> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Xenomai-help] Handling interrupt - jitter List-Id: Help regarding installation and common use of Xenomai List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gilles Chanteperdrix Cc: xenomai-help Gilles Chanteperdrix wrote: > On Fri, Apr 18, 2008 at 4:33 PM, Bosko Radivojevic > wrote: >> Hi, >> >> I'm having (from my perspective) too big jitter on handling >> interrupts. System is: ARM9, AT91SAM9260, Kernel 2.6.20.21, Adeos >> 1.8-03, Xenomai-2.4.2, interrupt is generated every 1ms, externally. > > It's funny to notice how much you asked for the 2.6.24 patch for > actually not using it. > >> Interrupt source (ET1200) is connected to IRQ1 pin (PC15). I'm using >> native skin from user space. Usually, handler 'reacts' after ~110us, >> but, worst case delay is around 250us! Is this performance >> normal/expected on my platform? Why the difference is so huge? > >> Is there anything I can do to get better results (with this hw:)? > > 250 us is the user-space dispatch latency you obtain with the > "latency" test on a properly loaded target. It is the time for a > user-space context switch with a full cache flush. To reduce this > latency you have to: > - handle interrupts in kernel space, so that you will be limited by > interrupt latency, not user-space scheduling latency > - use trunk so that user-space context switches involving real-time > threads do not happen with hardware interrupts off. I started to do some external interrupt latency measurements with gpioirqbench showing also the effect of handling the interrupt in user-space, kernel-space or even the interrupt handler on two PowerPC systems. For further information, have a look to http://www.denx.de/wiki/DULG/AN2008_03_Xenomai_gpioirqbench Wolfgang.