All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] testing interrupt latency
@ 2006-08-03 14:30 Bart Jonkers
  2006-08-03 18:00 ` Gilles Chanteperdrix
  2006-08-04  6:26 ` Jan Kiszka
  0 siblings, 2 replies; 4+ messages in thread
From: Bart Jonkers @ 2006-08-03 14:30 UTC (permalink / raw)
  To: xenomai

Hey,

I have written a small module to test the interrupt response time of
Xenomai to compare it with the time of Linux.

I generate an interrupt on a GPIO pin and toggles another GPIO pin in
the interrupt service routine. (code below)
The time between the generated interrupt and the value change on the
GPIO pin is taken as interrupt response time.

Everything works well, but I notice a strange behavior.
I thought that the interrupt response time of xenomai should be (as good
as) constant all the time. But I see that this is not the case.

Did I do something wrong in my code or did I made a wrong assumption?


Thanks, Bart



#include <linux/init.h>
#include <linux/module.h>

#include <asm/arch/pxa-regs.h>
#include <asm/arch/xsilo.h>

#include <native/intr.h>
#include <native/timer.h>

MODULE_LICENSE("Dual BSD/GPL");

RT_INTR intr_desc_but;

static int xsilo_irq_measure_irq_handler_but(struct xnintr *intr)
{
	/* Make GPIO pin low */
	GPCR(XSILO_JOYSTICK_UP_GPIO) |= GPIO_bit(XSILO_JOYSTICK_UP_GPIO);
	/* Wait 50µs */
	rt_timer_spin(50000);
	/* Make GPIO pin high */
	GPSR(XSILO_JOYSTICK_UP_GPIO) |= GPIO_bit(XSILO_JOYSTICK_UP_GPIO);
	return RT_INTR_HANDLED;
}

static int __init xsilo_irq_measure_init(void)
{
	int retval;
	/* initialize output GPIO pin */
	GPSR(XSILO_JOYSTICK_UP_GPIO) |= GPIO_bit(XSILO_JOYSTICK_UP_GPIO);
	GPDR(XSILO_JOYSTICK_UP_GPIO) |= GPIO_bit(XSILO_JOYSTICK_UP_GPIO);
	
	/* initialize interrupt and the receiving GPIO pin */
	retval = rt_intr_create(&intr_desc_but,"RT_measure_irq_but",
XSILO_MENU_IRQ,xsilo_irq_measure_irq_handler_but,NULL,I_EDGE);
	if (!retval){
		GPDR(XSILO_MENU_GPIO) |= GPIO_bit(XSILO_MENU_GPIO);
		set_irq_type(XSILO_MENU_IRQ, IRQT_RISING);
		rt_intr_enable(&intr_desc_but);
	}
	return 0;
}

static void __exit xsilo_irq_measure_exit(void)
{
	rt_intr_delete(&intr_desc_but);
}

module_init(xsilo_irq_measure_init);
module_exit(xsilo_irq_measure_exit);




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Xenomai-help] testing interrupt latency
  2006-08-03 14:30 [Xenomai-help] testing interrupt latency Bart Jonkers
@ 2006-08-03 18:00 ` Gilles Chanteperdrix
  2006-08-03 18:18   ` Philippe Gerum
  2006-08-04  6:26 ` Jan Kiszka
  1 sibling, 1 reply; 4+ messages in thread
From: Gilles Chanteperdrix @ 2006-08-03 18:00 UTC (permalink / raw)
  To: Bart Jonkers; +Cc: xenomai

Bart Jonkers wrote:
 > Hey,
 > 
 > I have written a small module to test the interrupt response time of
 > Xenomai to compare it with the time of Linux.
 > 
 > I generate an interrupt on a GPIO pin and toggles another GPIO pin in
 > the interrupt service routine. (code below)
 > The time between the generated interrupt and the value change on the
 > GPIO pin is taken as interrupt response time.
 > 
 > Everything works well, but I notice a strange behavior.
 > I thought that the interrupt response time of xenomai should be (as good
 > as) constant all the time. But I see that this is not the case.
 > 
 > Did I do something wrong in my code or did I made a wrong assumption?

What should be guaranteed by Xenomai is that the response time is
bounded, not that it is constant. Of course, we make all we can to make
the bound as small as possible, but each hardware has its
limits.

-- 


					    Gilles Chanteperdrix.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Xenomai-help] testing interrupt latency
  2006-08-03 18:00 ` Gilles Chanteperdrix
@ 2006-08-03 18:18   ` Philippe Gerum
  0 siblings, 0 replies; 4+ messages in thread
From: Philippe Gerum @ 2006-08-03 18:18 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai

On Thu, 2006-08-03 at 20:00 +0200, Gilles Chanteperdrix wrote:
> Bart Jonkers wrote:
>  > Hey,
>  > 
>  > I have written a small module to test the interrupt response time of
>  > Xenomai to compare it with the time of Linux.
>  > 
>  > I generate an interrupt on a GPIO pin and toggles another GPIO pin in
>  > the interrupt service routine. (code below)
>  > The time between the generated interrupt and the value change on the
>  > GPIO pin is taken as interrupt response time.
>  > 
>  > Everything works well, but I notice a strange behavior.
>  > I thought that the interrupt response time of xenomai should be (as good
>  > as) constant all the time. But I see that this is not the case.
>  > 
>  > Did I do something wrong in my code or did I made a wrong assumption?
> 
> What should be guaranteed by Xenomai is that the response time is
> bounded, not that it is constant. Of course, we make all we can to make
> the bound as small as possible, but each hardware has its
> limits.
> 

Indeed. Not to speak of the basic issue all real-time Linux
infrastructures (native or not) have to deal with, compared to purely
standalone RTOSes: the hardware is shared by GPOS services which do not
give a damn of our efforts to keep the latencies close to the hardware
limits. See TLB flushes, significant cache trashing, power saving
tricks, funky processor modes and friends. This is the price to pay for
having real-time and general purpose services integrated on a single and
commoditized hardware and software platform.

-- 
Philippe.




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Xenomai-help] testing interrupt latency
  2006-08-03 14:30 [Xenomai-help] testing interrupt latency Bart Jonkers
  2006-08-03 18:00 ` Gilles Chanteperdrix
@ 2006-08-04  6:26 ` Jan Kiszka
  1 sibling, 0 replies; 4+ messages in thread
From: Jan Kiszka @ 2006-08-04  6:26 UTC (permalink / raw)
  To: Bart Jonkers; +Cc: xenomai

[-- Attachment #1: Type: text/plain, Size: 613 bytes --]

Bart Jonkers wrote:
> Hey,
> 
> I have written a small module to test the interrupt response time of
> Xenomai to compare it with the time of Linux.
> 
> I generate an interrupt on a GPIO pin and toggles another GPIO pin in
> the interrupt service routine. (code below)
> The time between the generated interrupt and the value change on the
> GPIO pin is taken as interrupt response time.

Can we say that playing with such GPIO pins is a good generic way to
measure IRQ latencies on ARM platforms? If so, do you see a chance to
enhance the existing irqbench framework with this mechanism?

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-08-04  6:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-03 14:30 [Xenomai-help] testing interrupt latency Bart Jonkers
2006-08-03 18:00 ` Gilles Chanteperdrix
2006-08-03 18:18   ` Philippe Gerum
2006-08-04  6:26 ` Jan Kiszka

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.