[Xenomai] ipipe-gch-ipipe-3.0-imx6q latency
eric
ericvic at 163.com
Mon Dec 14 08:57:01 CET 2015
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;
}
At 2015-12-14 14:42:53, "Gilles Chanteperdrix" <gilles.chanteperdrix at xenomai.org> wrote:
>On Mon, Dec 14, 2015 at 10:13:57AM +0800, eric wrote:
>> 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?
>
>--
> Gilles.
>https://click-hack.org
More information about the Xenomai
mailing list