All of lore.kernel.org
 help / color / mirror / Atom feed
From: eric <ericvic@163.com>
To: "xenomai@xenomai.org" <xenomai@xenomai.org>
Subject: [Xenomai] ipipe-gch-ipipe-3.0-imx6q latency
Date: Tue, 8 Dec 2015 18:43:02 +0800 (CST)	[thread overview]
Message-ID: <44cb82ce.15337.151812ff429.Coremail.ericvic@163.com> (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");   

             reply	other threads:[~2015-12-08 10:43 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-08 10:43 eric [this message]
2015-12-08 11:23 ` [Xenomai] ipipe-gch-ipipe-3.0-imx6q latency Gilles Chanteperdrix
2015-12-14  2:13   ` eric
2015-12-14  6:42     ` Gilles Chanteperdrix
2015-12-14  7:57       ` eric
2015-12-14  8:03         ` Gilles Chanteperdrix
2015-12-14  8:30           ` eric
2015-12-14  9:04             ` [Xenomai] Compileerror rt_imx_uart.c on kernel 3.10.53 ARM Wolfgang Netbal
2015-12-14 22:48               ` Gilles Chanteperdrix
2015-12-14  9:05             ` [Xenomai] ipipe-gch-ipipe-3.0-imx6q latency eric
2015-12-14 22:19               ` Gilles Chanteperdrix
2015-12-15  0:54                 ` eric
2015-12-15  6:17                   ` Gilles Chanteperdrix
2015-12-15  7:05                     ` eric
2015-12-14  8:08         ` eric

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44cb82ce.15337.151812ff429.Coremail.ericvic@163.com \
    --to=ericvic@163.com \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.