From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Fri, 22 Jun 2007 00:54:48 -0700 (PDT) From: poornima r In-Reply-To: <1182434536.9709.62.camel@domain.hid> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1346712100-1182498888=:58719" Content-Transfer-Encoding: 8bit Message-ID: <487617.58719.qm@domain.hid> Subject: Re: [Adeos-main] Domain switching latencies List-Id: General discussion about Adeos List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: rpm@xenomai.org Cc: adeos-main@gna.org, wg@domain.hid --0-1346712100-1182498888=:58719 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Hello Philippe, Thanks very much for the reply. Thanks and Regards, Poornima Philippe Gerum wrote: On Thu, 2007-06-21 at 05:59 -0700, poornima r wrote: > > We are very thankful to you for providing help and > guidance in running latency testsuites and other > assignments > We are trying to measure context switching latencies > between primary and secondary domains with changes in > the > latency code as specified in the below link > http://www.mail-archive.com/xenomai@xenomai.org > > The following changes are done in the latency code and > the applications are attached > ------------------------------------------------------- > 1:Measured using linux call printf > err = rt_task_wait_period(&ov); > before = rt_timer_tsc(); > printf(" "); You are measuring time for buffered I/O operations, so your measure is fundamentally flawed, since this jump won't ever jump to kernel space unless the buffer gets full once in a while, and the stdio layer has to sync. At the very least, switch buffering off using setbuf(), give a newline into the string (depends on underlying termio setup in effect, so this is unreliable) or simply invoke an actual system call, like getpgrp() or getppid (and _not_ getpid() which is optimized using direct fetches from PTDs). > after = rt_timer_tsc(); > dt = (long)(after - before); > -------------------------------------------------------- > 2. Measure using Native API call > err = rt_task_wait_period(&ov); > before = rt_timer_tsc(); > rt_task_set_mode (T_PRIMARY, NULL, NULL); > after = rt_timer_tsc(); > dt = (long)(after - before); > --------------------------------------------------------- > The worst case latencies was around 20 us using printf > call and around 60 us when rt_task_set_mode was called > -- Philippe. --------------------------------- Got a little couch potato? Check out fun summer activities for kids. --0-1346712100-1182498888=:58719 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit
Hello Philippe,
 
Thanks very much for the reply.
 
Thanks and Regards,
Poornima


Philippe Gerum <rpm@xenomai.org> wrote:
On Thu, 2007-06-21 at 05:59 -0700, poornima r wrote:
>
> We are very thankful to you for providing help and
> guidance in running latency testsuites and other
> assignments
> We are trying to measure context switching latencies
> between primary and secondary domains with changes in
> the
> latency code as specified in the below link
> http://www.mail-archive.com/xenomai@xenomai.org
>
> The following changes are done in the latency code and
> the applications are attached
> -------------------------------------------------------
> 1:Measured using linux call printf
> err = rt_task_wait_period(&ov);
> before = rt_timer_tsc();
> printf(" ");

You are measuring time for buffered I/O operations, so your measure is
fundamentally flawed, since this jump won't ever jump to kernel space
unless the buffer gets full once in a while, and the stdio layer has to
sync. At the very least, switch buffering off using setbuf(), give a
newline into the string (depends on underlying termio setup in effect,
so this is unreliable) or simply invoke an actual system call, like
getpgrp() or getppid (and _not_ getpid() which is optimized using direct
fetches from PTDs).

> after = rt_timer_tsc();
> dt = (long)(after - before);
> --------------------------------------------------------
> 2. Measure using Native API call
> err = rt_task_wait_period(&ov);
> before = rt_timer_tsc();
> rt_task_set_mode (T_PRIMARY, NULL, NULL);
> after = rt_timer_tsc();
> dt = (long)(after - before);
> ---------------------------------------------------------
> The worst case latencies was around 20 us using printf
> call and around 60 us when rt_task_set_mode was called
>
--
Philippe.




Got a little couch potato?
Check out fun summer activities for kids. --0-1346712100-1182498888=:58719--