Skip to contentSkip to conversation

ipipe-gch-ipipe-3.0-imx6q latency

Xenomai eric 3 participants 15 messages Dec 8, 2015 – Dec 15, 2015

lore
Share & tools
lore

eric

author
#0 lore raw

hello:
I use xenomai-2.6.4 with kernel ipipe-gch-ipipe-3.0-imx6q.tar.bz2 with sample test , build the flow module with timer 250us cycle,if I make a user space application with memory copy ,the kernel latency will very big ,why??? thanks
latency :
pmax: 0.508624 ms
pmax: 0.533823 ms
pmax: 0.553197 ms
pmax: 0.603770 ms
pmax: 0.613982 ms
pmax: 0.638025 ms
pmax: 0.662129 ms
pmax: 0.699245 ms
pmax: 0.780533 ms
pmax: 0.800770 ms
pmax: 0.802066 ms
pmax: 0.813921 ms
pmax: 0.816330 ms
pmax: 0.820429 ms
pmax: 0.820483 ms
pmax: 0.821783 ms
pmax: 0.827649 ms
pmax: 0.833197 ms
pmax: 0.837606 ms
pmax: 0.843921 ms
pmax: 0.874033 ms
pmax: 0.892414 ms
pmax: 0.892788 ms

usr application:
#include <stdio.h>
int main()
{
char a[1024*1024]={9};

char b[1024*1024];
    while(1){
    memcpy(b,a,1024*800);
    }

return 0;
}

kernel module code :

#define TASK_PRIO 99 // 99 is Highest RT priority
#define TASK_MODE 0 // No flags
#define TASK_STKSZ 0 // default Stack size

#define TASK_PERIOD 250000ll // in nano seconds = 500 ms long long pmax,start,stop;
static rtdm_task_t td; //RTDM Real time task pointer
char logo[40*1024]={0};
char mem_spvm[40*1024];
long long runcount=0;
void periodic (void *arg) {
long max,pmax;

for (;;) {
rtdm_task_wait_period(); //deschedule until next period

stop =rtdm_clock_read();
memset(mem_spvm,0,sizeof(logo));
memcpy(mem_spvm,logo,sizeof(logo));
memset(mem_spvm,127,sizeof(logo));
memcpy(mem_spvm,logo,sizeof(logo));

//stop = rtdm_clock_read();
if(runcount<1000)
{
pmax=0;
}
if(pmax<(stop-start)){
pmax=stop-start;
printk("pmax: %ld.%06ld ms\n",(long)pmax/1000000,(long)pmax%1000000);
}
start=stop;
runcount++;
}
}

int init_module(void) {
return rtdm_task_init (&td, "periodic", &periodic, NULL, TASK_PRIO,TASK_PERIOD);
}

void cleanup_module(void) {
rtdm_task_destroy(&td);
}

MODULE_LICENSE("GPL");

#1 lore raw
Quoted 6 lines · eric

hello:
I use xenomai-2.6.4 with kernel
ipipe-gch-ipipe-3.0-imx6q.tar.bz2 with sample test , build the flow module with timer 250us cycle,if I make a user space application with memory copy ,the kernel latency will very big ,why??? thanks

Do you have the same problem if you use a recent mainline kernel? Such as 3.14 or 3.18 ?

Signature · 2 lines
					    Gilles.
https://click-hack.org
author
#2 lore raw

It is much better with 3.18.20 ,it is the test result with xenomai-3.0.1 500us cycle ,still a little big ,thanks!
-sh-2.05b# [ 154.812032] pmax: 0.597303 ms

[  245.216863] pmax: 0.600940 ms
[  249.992395] pmax: 0.603288 ms
[  277.280006] pmax: 0.610470 ms
Quoted 14 lines · Gilles Chanteperdrix
Quoted 6 lines · eric

hello:
I use xenomai-2.6.4 with kernel
ipipe-gch-ipipe-3.0-imx6q.tar.bz2 with sample test , build the flow module with timer 250us cycle,if I make a user space application with memory copy ,the kernel latency will very big ,why??? thanks

Do you have the same problem if you use a recent mainline kernel? Such as 3.14 or 3.18 ?

Signature · 2 lines
					    Gilles.
https://click-hack.org
#3 lore raw
Quoted 5 lines · eric

It is much better with 3.18.20 ,it is the test result with xenomai-3.0.1 500us cycle ,still a little big ,thanks!
-sh-2.05b# [ 154.812032] pmax: 0.597303 ms

[  245.216863] pmax: 0.600940 ms
[  249.992395] pmax: 0.603288 ms
[  277.280006] pmax: 0.610470 ms

I am not sure about what you measure, but if you observe a 500us latency, you have a problem.

What latency does Xenomai latency test give?

Signature · 2 lines
					    Gilles.
https://click-hack.org
author
#4 lore raw

kernel space:

#define TASK_PRIO 99 // 99 is Highest RT priority #define TASK_MODE 0 // No flags
#define TASK_STKSZ 0 // default Stack size #define TASK_PERIOD 500000ll // in nano seconds = 500 ms long long pmax,start,stop;
static rtdm_task_t td; //RTDM Real time task pointer
char logo[40*1024];
char mem_spvm[40*1024];
long long runcount=0;

void periodic (void *arg) {
long max,pmax;
for (;;) {
rtdm_task_wait_period(NULL); //deschedule until next period
stop =rtdm_clock_read();
memset(mem_spvm,0,sizeof(logo));
memcpy(mem_spvm,logo,sizeof(logo));
memset(mem_spvm,127,sizeof(logo));
memcpy(mem_spvm,logo,sizeof(logo));
memset(mem_spvm,0,sizeof(logo));
memcpy(mem_spvm,logo,sizeof(logo));
memset(mem_spvm,127,sizeof(logo));
memcpy(mem_spvm,logo,sizeof(logo));
memset(mem_spvm,0,sizeof(logo));
memcpy(mem_spvm,logo,sizeof(logo));
memset(mem_spvm,127,sizeof(logo));
if(runcount<1000)
{
pmax=0;
}
if(pmax<(stop-start)){
pmax=stop-start;
printk("pmax: %ld.%06ld ms\n",(long)pmax/1000000,(long)pmax%1000000);
}
start=stop;
runcount++;
}
}
int init_module(void) {
return rtdm_task_init (&td, "periodic", &periodic, NULL, TASK_PRIO,TASK_PERIOD);
}

void cleanup_module(void) {
rtdm_task_destroy(&td);
}

user space:

#include <stdio.h>
int main()
{
char a[1024*1024]={0xff};
char b[1024*1024];
int i=0;
while(1){

for(i=1000000;i>0;i--)
system("sync");
memcpy(b,a,1024*800);
}
return 0;
}

Quoted 15 lines · Gilles Chanteperdrix
Quoted 5 lines · eric

It is much better with 3.18.20 ,it is the test result with xenomai-3.0.1 500us cycle ,still a little big ,thanks!
-sh-2.05b# [ 154.812032] pmax: 0.597303 ms

[  245.216863] pmax: 0.600940 ms
[  249.992395] pmax: 0.603288 ms
[  277.280006] pmax: 0.610470 ms

I am not sure about what you measure, but if you observe a 500us latency, you have a problem.

What latency does Xenomai latency test give?

Signature · 2 lines
					    Gilles.
https://click-hack.org
#5 lore raw
Quoted 1 line · eric

kernel space:

This does not answer my question. here is my question again, so that you can read it again:

Quoted 1 line
Quoted 1 line

What latency does Xenomai latency test give?

Signature · 2 lines
					    Gilles.
https://click-hack.org
author
#14 lore raw
In reply to eric

And with x86 dual core the same test the result quite good just 13us latency , but just imx6q for a long time the result not very well.

At 2015-12-14 15:57:01, "eric" <[email protected]> wrote:

kernel space:

#define TASK_PRIO 99 // 99 is Highest RT priority #define TASK_MODE 0 // No flags
#define TASK_STKSZ 0 // default Stack size #define TASK_PERIOD 500000ll // in nano seconds = 500 ms long long pmax,start,stop;
static rtdm_task_t td; //RTDM Real time task pointer
char logo[40*1024];
char mem_spvm[40*1024];
long long runcount=0;

void periodic (void *arg) {
long max,pmax;
for (;;) {
rtdm_task_wait_period(NULL); //deschedule until next period
stop =rtdm_clock_read();
memset(mem_spvm,0,sizeof(logo));
memcpy(mem_spvm,logo,sizeof(logo));
memset(mem_spvm,127,sizeof(logo));
memcpy(mem_spvm,logo,sizeof(logo));
memset(mem_spvm,0,sizeof(logo));
memcpy(mem_spvm,logo,sizeof(logo));
memset(mem_spvm,127,sizeof(logo));
memcpy(mem_spvm,logo,sizeof(logo));
memset(mem_spvm,0,sizeof(logo));
memcpy(mem_spvm,logo,sizeof(logo));
memset(mem_spvm,127,sizeof(logo));
if(runcount<1000)
{
pmax=0;
}
if(pmax<(stop-start)){
pmax=stop-start;
printk("pmax: %ld.%06ld ms\n",(long)pmax/1000000,(long)pmax%1000000);
}
start=stop;
runcount++;
}
}
int init_module(void) {
return rtdm_task_init (&td, "periodic", &periodic, NULL, TASK_PRIO,TASK_PERIOD);
}

void cleanup_module(void) {
rtdm_task_destroy(&td);
}

user space:

#include <stdio.h>
int main()
{
char a[1024*1024]={0xff};
char b[1024*1024];
int i=0;
while(1){

for(i=1000000;i>0;i--)
system("sync");
memcpy(b,a,1024*800);
}
return 0;
}

Quoted 15 lines · Gilles Chanteperdrix
Quoted 5 lines · eric

It is much better with 3.18.20 ,it is the test result with xenomai-3.0.1 500us cycle ,still a little big ,thanks!
-sh-2.05b# [ 154.812032] pmax: 0.597303 ms

[  245.216863] pmax: 0.600940 ms
[  249.992395] pmax: 0.603288 ms
[  277.280006] pmax: 0.610470 ms

I am not sure about what you measure, but if you observe a 500us latency, you have a problem.

What latency does Xenomai latency test give?

Signature · 2 lines
					    Gilles.
https://click-hack.org
author
#6 lore raw
In reply to Gilles Chanteperdrix

I use latency test ,it show this

-sh-2.05b# ./latency

   0"000.000| WARNING: [main] cannot open RTDM device /dev/rtdm/memdev-private: No such file or directory
   0"000.000| WARNING: [main] cannot map private umm area: No such file or directory
   0"000.000| BUG in init_bind(): [main] (CONFIG_DEVTMPFS_MOUNT not enabled?)
-sh-2.05b# ./latency  -t 1
   0"000.000| WARNING: [main] cannot open RTDM device /dev/rtdm/memdev-private: No such file or directory
   0"000.000| WARNING: [main] cannot map private umm area: No such file or directory
   0"000.000| BUG in init_bind(): [main] (CONFIG_DEVTMPFS_MOUNT not enabled?)
Quoted 11 lines · Gilles Chanteperdrix
Quoted 1 line · eric

kernel space:

This does not answer my question. here is my question again, so that you can read it again:

Quoted 1 line
Quoted 1 line

What latency does Xenomai latency test give?

Signature · 2 lines
					    Gilles.
https://click-hack.org
#7 lore raw

[Xenomai] Compileerror rt_imx_uart.c on kernel 3.10.53 ARM

Dear All,

when I activated the serial realtime driver (CONFIG_XENO_DRIVERS_IMX_UART) in my kernel 3.10.53 I get the following compile errors.

drivers/xenomai/serial/rt_imx_uart.c: In function 'rt_imx_uart_probe':

drivers/xenomai/serial/rt_imx_uart.c:2032:20: error: 'struct imxuart_platform_data' has no member named 'init'

  if (pdata && pdata->init) {
                    ^

drivers/xenomai/serial/rt_imx_uart.c:2033:14: error: 'struct imxuart_platform_data' has no member named 'init'

   err = pdata->init(pdev);
              ^

drivers/xenomai/serial/rt_imx_uart.c:2095:20: error: 'struct imxuart_platform_data' has no member named 'exit'

  if (pdata && pdata->exit)
                    ^

drivers/xenomai/serial/rt_imx_uart.c:2096:8: error: 'struct imxuart_platform_data' has no member named 'exit'

   pdata->exit(pdev);
        ^

drivers/xenomai/serial/rt_imx_uart.c: In function 'rt_imx_uart_remove':

drivers/xenomai/serial/rt_imx_uart.c:2126:20: error: 'struct imxuart_platform_data' has no member named 'exit'

  if (pdata && pdata->exit)
                    ^

drivers/xenomai/serial/rt_imx_uart.c:2127:8: error: 'struct imxuart_platform_data' has no member named 'exit'

   pdata->exit(pdev);

I found out that in kernel 3.10.53 the function pointer to exit and init function in struct imxuart_platform_data is missing.

I tried to find a newer version of rt_imx_uart.c in xenomai 3.0 but the file is the same.

Do you have any idea how to fix this ?

Kind regards
Wolfgang

author
#9 lore raw
In reply to eric

Above i use the wrong version about latency test , now it works and the latency test

RTD|     22.513|     39.832|     60.649|       0|     0|     11.269|     63.939
RTD|     27.225|     40.068|     61.134|       0|     0|     11.269|     63.939
RTD|     27.270|     40.531|     60.103|       0|     0|     11.269|     63.939
RTD|     14.876|     39.540|     61.451|       0|     0|     11.269|     63.939
RTD|     15.890|     39.760|     68.512|       0|     0|     11.269|     68.512
RTD|     10.951|     29.915|     61.269|       0|     0|     10.951|     68.512
RTD|     10.981|     12.596|     15.118|       0|     0|     10.951|     68.512
RTD|     10.814|     12.648|     16.284|       0|     0|     10.814|     68.512
RTD|     10.920|     12.636|     15.057|       0|     0|     10.814|     68.512
RTT|  00:09:38  (periodic user-mode task, 1000 us period, priority 99)
RTH|----lat min|----lat avg|----lat max|-overrun|---msw|---lat best|--lat worst
RTD|     10.784|     12.672|     15.465|       0|     0|     10.784|     68.512
RTD|     11.071|     12.602|     15.374|       0|     0|     10.784|     68.512
RTD|     10.904|     12.632|     14.859|       0|     0|     10.784|     68.512
RTD|     10.934|     12.639|     15.056|       0|     0|     10.784|     68.512
RTD|     11.010|     12.575|     15.146|       0|     0|     10.784|     68.512

At 2015-12-14 16:30:40, "eric" <[email protected]> wrote:

I use latency test ,it show this

-sh-2.05b# ./latency

   0"000.000| WARNING: [main] cannot open RTDM device /dev/rtdm/memdev-private: No such file or directory
   0"000.000| WARNING: [main] cannot map private umm area: No such file or directory
   0"000.000| BUG in init_bind(): [main] (CONFIG_DEVTMPFS_MOUNT not enabled?)
-sh-2.05b# ./latency  -t 1
   0"000.000| WARNING: [main] cannot open RTDM device /dev/rtdm/memdev-private: No such file or directory
   0"000.000| WARNING: [main] cannot map private umm area: No such file or directory
   0"000.000| BUG in init_bind(): [main] (CONFIG_DEVTMPFS_MOUNT not enabled?)
Quoted 11 lines · Gilles Chanteperdrix
Quoted 1 line · eric

kernel space:

This does not answer my question. here is my question again, so that you can read it again:

Quoted 1 line
Quoted 1 line

What latency does Xenomai latency test give?

Signature · 2 lines
					    Gilles.
https://click-hack.org
#10 lore raw
Quoted 19 lines · eric

Above i use the wrong version about latency test , now it works and the latency test

RTD|     22.513|     39.832|     60.649|       0|     0|     11.269|     63.939
RTD|     27.225|     40.068|     61.134|       0|     0|     11.269|     63.939
RTD|     27.270|     40.531|     60.103|       0|     0|     11.269|     63.939
RTD|     14.876|     39.540|     61.451|       0|     0|     11.269|     63.939
RTD|     15.890|     39.760|     68.512|       0|     0|     11.269|     68.512
RTD|     10.951|     29.915|     61.269|       0|     0|     10.951|     68.512
RTD|     10.981|     12.596|     15.118|       0|     0|     10.951|     68.512
RTD|     10.814|     12.648|     16.284|       0|     0|     10.814|     68.512
RTD|     10.920|     12.636|     15.057|       0|     0|     10.814|     68.512
RTT|  00:09:38  (periodic user-mode task, 1000 us period, priority 99)
RTH|----lat min|----lat avg|----lat max|-overrun|---msw|---lat best|--lat worst
RTD|     10.784|     12.672|     15.465|       0|     0|     10.784|     68.512
RTD|     11.071|     12.602|     15.374|       0|     0|     10.784|     68.512
RTD|     10.904|     12.632|     14.859|       0|     0|     10.784|     68.512
RTD|     10.934|     12.639|     15.056|       0|     0|     10.784|     68.512
RTD|     11.010|     12.575|     15.146|       0|     0|     10.784|     68.512

So the latency is below 100us, much less than 500us. It seems a bit high though, do you have any debug option enabled? Do you run this with a real-time load?

Signature · 2 lines
					    Gilles.
https://click-hack.org
#8 lore raw

Re: [Xenomai] Compileerror rt_imx_uart.c on kernel 3.10.53 ARM

In reply to Wolfgang Netbal
Quoted 46 lines · Wolfgang Netbal

Dear All,

when I activated the serial realtime driver (CONFIG_XENO_DRIVERS_IMX_UART) in my kernel 3.10.53 I get the following compile errors.

drivers/xenomai/serial/rt_imx_uart.c: In function 'rt_imx_uart_probe':

drivers/xenomai/serial/rt_imx_uart.c:2032:20: error: 'struct imxuart_platform_data' has no member named 'init'

   if (pdata && pdata->init) {
                     ^

drivers/xenomai/serial/rt_imx_uart.c:2033:14: error: 'struct imxuart_platform_data' has no member named 'init'

    err = pdata->init(pdev);

               ^

drivers/xenomai/serial/rt_imx_uart.c:2095:20: error: 'struct imxuart_platform_data' has no member named 'exit'

   if (pdata && pdata->exit)
                     ^

drivers/xenomai/serial/rt_imx_uart.c:2096:8: error: 'struct imxuart_platform_data' has no member named 'exit'

    pdata->exit(pdev);

         ^

drivers/xenomai/serial/rt_imx_uart.c: In function 'rt_imx_uart_remove':

drivers/xenomai/serial/rt_imx_uart.c:2126:20: error: 'struct imxuart_platform_data' has no member named 'exit'

   if (pdata && pdata->exit)
                     ^

drivers/xenomai/serial/rt_imx_uart.c:2127:8: error: 'struct imxuart_platform_data' has no member named 'exit'

    pdata->exit(pdev);
Quoted 7 lines

I found out that in kernel 3.10.53 the function pointer to exit and init function in struct imxuart_platform_data is missing.

I tried to find a newer version of rt_imx_uart.c in xenomai 3.0 but the file is the same.

Do you have any idea how to fix this ?

Maybe the file is adapted to newer kernel versions? Such as Linux 3.14 or Linux 3.18 ?

Please try, if you want to answer a random mail, to remove any reference-to or in-reply-to header, so that your mail does not appear in a middle of an unrelated thread. Look at the mess you have done here:
https://xenomai.org/pipermail/xenomai/2015-December/thread.html

Signature · 2 lines
					    Gilles.
https://click-hack.org
author
#11 lore raw
In reply to Gilles Chanteperdrix
Quoted 8 lines

So the latency is below 100us, much less than 500us. It seems a bit high though, do you have any debug option enabled? Do you run this with a real-time load?

Signature · 2 lines
					    Gilles.
https://click-hack.org

I can not run real-time load ,it always stop the flowing step. So i use some other load program .And I do not enabled debug option.

root@imx6qdlsolo:/opt/x3/bin# ./xeno-test
Started child 29228: /bin/sh /usr/xenomai/bin/xeno-test-run-wrapper ./xeno-test
++ echo 0
++ testdir=/opt/imx6/smp3/xenomai-3.0.1/x3/bin
++ /opt/imx6/smp3/xenomai-3.0.1/x3/bin/smokey --run
arith OK
bufp OK
iddp OK
leaks OK
#12 lore raw
Quoted 10 lines · eric
Quoted 8 lines

So the latency is below 100us, much less than 500us. It seems a bit high though, do you have any debug option enabled? Do you run this with a real-time load?

Signature · 2 lines
					    Gilles.
https://click-hack.org

I can not run real-time load ,it always stop the flowing step. So i use some other load program .And I do not enabled debug option.

Quoted 9 lines
root@imx6qdlsolo:/opt/x3/bin# ./xeno-test
Started child 29228: /bin/sh /usr/xenomai/bin/xeno-test-run-wrapper ./xeno-test
++ echo 0
++ testdir=/opt/imx6/smp3/xenomai-3.0.1/x3/bin
++ /opt/imx6/smp3/xenomai-3.0.1/x3/bin/smokey --run
arith OK
bufp OK
iddp OK
leaks OK

I was rather thinking about running the user-space load which creates high latencies with your own latency test.

But if you are interested in running xeno-test, you should check its syntax:
- either by running it with the -h or --help argument
- or by checking its manual page, either on your disk or on xenomai website:
https://xenomai.org/documentation/xenomai-3/html/man1/xeno-test/
- or by reading the page where we explain how we do the benchmarks we publish:
https://xenomai.org/2014/07/benchmarking-with-xeno-test/

Regards.

Signature · 2 lines
					    Gilles.
https://click-hack.org
author
#13 lore raw

ok,thanks very much!

Quoted 39 lines · Gilles Chanteperdrix
Quoted 10 lines · eric
Quoted 8 lines

So the latency is below 100us, much less than 500us. It seems a bit high though, do you have any debug option enabled? Do you run this with a real-time load?

Signature · 2 lines
					    Gilles.
https://click-hack.org

I can not run real-time load ,it always stop the flowing step. So i use some other load program .And I do not enabled debug option.

Quoted 9 lines
root@imx6qdlsolo:/opt/x3/bin# ./xeno-test
Started child 29228: /bin/sh /usr/xenomai/bin/xeno-test-run-wrapper ./xeno-test
++ echo 0
++ testdir=/opt/imx6/smp3/xenomai-3.0.1/x3/bin
++ /opt/imx6/smp3/xenomai-3.0.1/x3/bin/smokey --run
arith OK
bufp OK
iddp OK
leaks OK

I was rather thinking about running the user-space load which creates high latencies with your own latency test.

But if you are interested in running xeno-test, you should check its syntax:
- either by running it with the -h or --help argument
- or by checking its manual page, either on your disk or on xenomai website:
https://xenomai.org/documentation/xenomai-3/html/man1/xeno-test/
- or by reading the page where we explain how we do the benchmarks we publish:
https://xenomai.org/2014/07/benchmarking-with-xeno-test/

Regards.

Signature · 2 lines
					    Gilles.
https://click-hack.org