[Xenomai] ipipe-gch-ipipe-3.0-imx6q latency

eric ericvic at 163.com
Tue Dec 8 11:43:02 CET 2015


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");   


More information about the Xenomai mailing list