imx1 port.
Subsystems (3)
Hello all,
I had time to try again adeos+xenomai on a imx1 board. (i know this is quite old).
This looks stable, i have been testing for several hours.
I have followed the wiki documentation and performed some tests with xeno-test + ping flooding on this board, again i have no other *similar* board to compare results with, but here they are.
I wonder if the difference between user-mode and in-kernel mode should be as much as this...
By the way enabling ipipe tracer increase response time by a factor 2! is this ok with such HW ?
I have attached the patch if someone is interested in, any remarks regarding this are welcome.
All tests have been performed with xeno-test + ping flooding the board.
----
# cat /proc/ipipe/version 1.7-06 # cat /proc/xenomai/version 2.3.4
running: ./run -- -p 500 -T 120 -t0 # latency
*
*
* Type ^C to stop this application.
*
*
== Sampling period: 500 us
== Test mode: periodic user-mode task
== All results in microseconds
warming up...
RTT| 00:00:01 (periodic user-mode task, 500 us period, priority 99) RTH|-----lat min|-----lat avg|-----lat max|-overrun|----lat best|---lat worst RTD| 83.062| 116.437| 125.437| 0| 83.062| 125.437 RTD| 54.500| 118.375| 141.437| 0| 54.500| 141.437 RTD| 53.437| 120.187| 145.500| 0| 53.437| 145.500 RTD| 50.312| 119.375| 149.000| 0| 50.312| 149.000 RTD| 55.562| 116.375| 124.750| 0| 50.312| 149.000 ... ---|------------|------------|------------|--------|------------------------- RTS| 45.250| 118.500| 150.937| 0| 00:02:00/00:02:00
Thu Jan 1 00:24:02 GMT 1970
running: ./run -- -p 500 -T 120 -t1 # latency
*
*
* Type ^C to stop this application.
*
*
== Sampling period: 500 us
== Test mode: in-kernel periodic task
== All results in microseconds
warming up...
RTT| 00:00:01 (in-kernel periodic task, 500 us period, priority 99) RTH|-----lat min|-----lat avg|-----lat max|-overrun|----lat best|---lat worst RTD| 8.812| 19.329| 57.625| 0| 8.812| 57.625 RTD| 8.812| 15.628| 57.125| 0| 8.812| 57.625 RTD| 8.812| 16.827| 70.562| 0| 8.812| 70.562 RTD| 8.812| 29.156| 56.562| 0| 8.812| 70.562
...
RTS| 8.437| 17.812| 78.437| 0| 00:02:00/00:02:00
Thu Jan 1 00:26:09 GMT 1970
running: ./run -- -p 500 -T 120 -t2 # latency
*
*
* Type ^C to stop this application.
*
*
== Sampling period: 500 us
== Test mode: in-kernel timer handler
== All results in microseconds
warming up...
RTT| 00:00:01 (in-kernel timer handler, 500 us period, priority 99) RTH|-----lat min|-----lat avg|-----lat max|-overrun|----lat best|---lat worst RTD| 1.250| 7.492| 21.000| 0| 1.250| 21.000 RTD| 1.250| 5.211| 27.375| 0| 1.250| 27.375 RTD| 1.312| 5.299| 28.812| 0| 1.250| 28.812
...
RTS| 1.187| 4.335| 44.437| 0| 00:02:00/00:02:00
Thu Jan 1 00:28:15 GMT 1970
running: ./run -- -T 120 # switchtest
*
*
* Type ^C to stop this application.
*
*
== Testing FPU check routines...
== FPU check routines: unimplemented, skipping FPU switches tests. == Threads: sleeper-0 rtk-1 rtk-2 rtup-3 rtup-4 rtus-5 rtus-6 rtuo-7 rtuo-8
RTT| 00:00:01 RTH|ctx switches|-------total RTD| 900| 900 RTD| 900| 1800 RTD| 909| 2709
...
running: ./run -- -p 500 -h # switchbench
*
*
* Type ^C to stop this application.
*
*
== Sampling period: 500 us
== Do not interrupt this program
RTH| lat min| lat avg| lat max| lost RTD| 47.937| 50.250| 88.687| 0 ---|---range-|---samples HSD| 47 - 48 | 1 HSD| 48 - 49 | 40757 HSD| 49 - 50 | 55940 HSD| 50 - 51 | 9 HSD| 67 - 68 | 1 HSD| 68 - 69 | 4 HSD| 86 - 87 | 75 HSD| 87 - 88 | 2741 HSD| 88 - 89 | 468 HSS| 99996| 49.845| 6.888
include/asm-arm/arch-imx/irqs.h +13 -0
@@ -113,4 +113,17 @@#define NR_IRQS (IRQ_GPIOD(32) + 1)#define IRQ_GPIO (x) + +#ifdef CONFIG_IPIPE +#define __ipipe_irqbit (irq) (1ULL << (irq)) + +#define __ipipe_muxed_irqmask (__ipipe_irqbit(GPIO_INT_PORTA) | \ + __ipipe_irqbit(GPIO_INT_PORTB) | \ + __ipipe_irqbit(GPIO_INT_PORTC) | \ + __ipipe_irqbit(GPIO_INT_PORTD)) + +#define __ipipe_mach_irq_mux_p (irq) (__ipipe_irqbit(irq) \ + & __ipipe_muxed_irqmask) +#endif /* CONFIG_IPIPE */ +#endif
include/asm-arm/arch-imx/imx-regs.h +10 -0
@@ -345,7 +345,16 @@#define IMX_INTDISNUM __REG(IMX_AITC_BASE+0x0c)#define IMX_INTENABLEH __REG(IMX_AITC_BASE+0x10)#define IMX_INTENABLEL __REG(IMX_AITC_BASE+0x14) +#define IMX_PRIO7 __REG(IMX_AITC_BASE+0x20) +#define IMX_PRIO6 __REG(IMX_AITC_BASE+0x24) +#define IMX_PRIO5 __REG(IMX_AITC_BASE+0x28) +#define IMX_PRIO4 __REG(IMX_AITC_BASE+0x2C) +#define IMX_PRIO3 __REG(IMX_AITC_BASE+0x30) +#define IMX_PRIO2 __REG(IMX_AITC_BASE+0x34) +#define IMX_PRIO1 __REG(IMX_AITC_BASE+0x38) +#define IMX_PRIO0 __REG(IMX_AITC_BASE+0x3C) +#define IMX_PRIO (x) __REG2(IMX_AITC_BASE+0x20,((7-((x)>>3)) <<2) )/* * General purpose timers */
@@ -415,6 +424,7 @@#define PCR_BPIX_8 (3<<25)#define PCR_BPIX_12 (4<<25)#define PCR_BPIX_16 (4<<25) +#define PCR_BPIX_MASK (7<<25)#define PCR_PIXPOL (1<<24)#define PCR_FLMPOL (1<<23)#define PCR_LPPOL (1<<22)
arch/arm/mach-imx/irq.c +123 -1
151 lines not on this page · raw message
--- linux-2.6.20.12/arch/arm/mach-imx/time.c 2007-10-10 17:11:18.000000000 +0200
+++ linux-2.6.20.12-ipipe/arch/arm/mach-imx/time.c 2007-10-11 12:42:07.000000000 +0200
time.c renamed from time.c.orig +155 -5
201 lines not on this page · raw message
Quoted 4 lines · garryt
Hello all,
I had time to try again adeos+xenomai on a imx1 board. (i know this is quite old).
Thanks. The imx port should be integrated in the next I-pipe patch.
Quoted 11 lines
This looks stable, i have been testing for several hours.
I have followed the wiki documentation and performed some tests with xeno-test + ping flooding on this board, again i have no other *similar* board to compare results with, but here they are.
I wonder if the difference between user-mode and in-kernel mode should be as much as this...
From the tests I have seen so far, except those published by Adeneo,
there is always a great difference between user-mode an kernel-mode. This is the price to pay for the comfort of user-space on ARM.
Quoted 3 lines
By the way enabling ipipe tracer increase response time by a factor 2! is this ok with such HW ?
I guess so.
Quoted 3 lines
I have attached the patch if someone is interested in, any remarks regarding this are welcome.
There is something suspicious, it is the loop:
do {
write_seqlock(&xtime_lock); timer_tick();
+#ifdef CONFIG_IPIPE
+ last_jiffy_time += LATCH;
+#endif /* CONFIG_IPIPE */
write_sequnlock(&xtime_lock); IMX_TCMP(TIMER_BASE) += evt_diff;
} while (unlikely((int32_t) (IMX_TCMP(TIMER_BASE)
- IMX_TCN(TIMER_BASE)) < 0));
First, you should not touch IMX_TCMP(TIMER_BASE) in the loop, this is done by __ipipe_mach_set_dec.
Second, with the current version of the I-pipe, the do/while loop should be disabled when CONFIG_IPIPE is enabled. However, this is going to change in the next version of I-pipe because of the so-called "flat log" optimization, but I think IMX_TCMP(TIMER_BASE) should be replaced with last_jiffy_time, because IMX_TCMP(TIMER_BASE) is the date of the previous hardware timer tick, but the previous hardware timer tick is not necessarily Linux timer previous tick. Anyway, I will try and fix this and send a patch for testing.
Quoted 3 lines
All tests have been performed with xeno-test + ping flooding the board.
For a load that give worse figures, run the calibrator
http://www.cwi.nl/~manegold/Calibrator
Signature · 1 line
Gilles Chanteperdrix
Hello,
Selon Gilles Chanteperdrix <[email protected]>:
Quoted 54 lines · garryt
Quoted 3 lines
Hello all,
I had time to try again adeos+xenomai on a imx1 board. (i know this is
quite
Quoted 1 line
old).
Thanks. The imx port should be integrated in the next I-pipe patch.
Quoted 4 lines
This looks stable, i have been testing for several hours.
I have followed the wiki documentation and performed some tests with
xeno-test +
Quoted 1 line
ping flooding on this board, again i have no other *similar* board to
compare
Quoted 3 lines
results with, but here they are.
I wonder if the difference between user-mode and in-kernel mode should be
as
Quoted 1 line
much as this...
From the tests I have seen so far, except those published by Adeneo, there is always a great difference between user-mode an kernel-mode. This is the price to pay for the comfort of user-space on ARM.
Quoted 2 lines
By the way enabling ipipe tracer increase response time by a factor 2! is
this
Quoted 1 line
ok with such HW ?
I guess so.
Quoted 2 lines
I have attached the patch if someone is interested in, any remarks
regarding
Quoted 1 line
this are welcome.
There is something suspicious, it is the loop:
time.c renamed from time.c.orig +3
-0do {write_seqlock (&xtime_lock);timer_tick (); +#ifdef CONFIG_IPIPE + last_jiffy_time +=LATCH ; +#endif /* CONFIG_IPIPE */ write_sequnlock (&xtime_lock);IMX_TCMP (TIMER_BASE ) += evt_diff; }while (unlikely ((int32_t ) (IMX_TCMP (TIMER_BASE ) -IMX_TCN (TIMER_BASE )) <0 ));First, you should not touch
IMX_TCMP(TIMER_BASE)in the loop, this is done by__ipipe_mach_set_dec.
Quoted 9 lines
Second, with the current version of the I-pipe, the do/while loop should be disabled when
CONFIG_IPIPEis enabled. However, this is going to change in the next version of I-pipe because of the so-called "flat log" optimization, but I thinkIMX_TCMP(TIMER_BASE)should be replaced withlast_jiffy_time, becauseIMX_TCMP(TIMER_BASE)is the date of the previous hardware timer tick, but the previous hardware timer tick is not necessarily Linux timer previous tick. Anyway, I will try and fix this and send a patch for testing.
Please correct me if i am wrong, this will help, my understanding from the comment in the function (in 1.7-06.patch), was that if another domain (xenomai) has stolen the timer we should do nothing neither ack it (already done), nor reprogram the timer in linux interrupt handler...just run timer_tick. (should i used time_lock)
I though that if we enter the loop this means that the timer programming is still held by linux not xenomai.
Quoted 11 lines
Quoted 3 lines
All tests have been performed with xeno-test + ping flooding the board.
For a load that give worse figures, run the calibrator
http://www.cwi.nl/~manegold/Calibrator--
Gilles Chanteperdrix
Quoted 8 lines · garryt
Please correct me if i am wrong, this will help, my understanding from the comment in the function (in 1.7-06.patch), was that if another domain (xenomai) has stolen the timer we should do nothing neither ack it (already done), nor reprogram the timer in linux interrupt handler...just run
timer_tick. (should i usedtime_lock)I though that if we enter the loop this means that the timer programming is still held by linux not xenomai.
Right, the only thing which should be skipped is what is in __ipipe_mach_acktimer. So, sorry for the noise, your patch is OK.
Signature · 1 line
Gilles Chanteperdrix