All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Christoph Permes <christoph.permes@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] Negative Latency results
Date: Thu, 27 Aug 2009 19:13:59 +0200	[thread overview]
Message-ID: <4A96BED7.4030707@domain.hid> (raw)
In-Reply-To: <1251376399.4321.44.camel@domain.hid>

Christoph Permes wrote:
> Am Donnerstag, den 27.08.2009, 14:05 +0200 schrieb Gilles Chanteperdrix:
>> Christoph Permes wrote:
>>> Hi,
>>>
>>> I'm working together with Peter on the latency problem.
>>>
>>> I have attached our kernel configuration and the boot log to this mail.
>>>
>>> We have tried out configuring a latency between 0 and 10000 but this
>>> didn't help.
>> Ok. Could you try the following patch:
>>
>> diff --git a/include/asm-generic/bits/timeconv.h
>> b/include/asm-generic/bits/timeconv.h
>> index 9a89fe9..654f17f 100644
>> --- a/include/asm-generic/bits/timeconv.h
>> +++ b/include/asm-generic/bits/timeconv.h
>> @@ -37,6 +37,11 @@ long long xnarch_tsc_to_ns_rounded(long long ticks)
>>         unsigned int shift = tsc_shift - 1;
>>         return (xnarch_llmulshft(ticks, tsc_scale, shift) + 1) / 2;
>>  }
>> +
>> +long long xnarch_ns_to_tsc(long long ns)
>> +{
>> +       return xnarch_llimd(ns, 1 << tsc_shift, tsc_scale);
>> +}
>>  #else  /* !XNARCH_HAVE_LLMULSHFT */
>>  long long xnarch_tsc_to_ns(long long ticks)
>>  {
>> @@ -46,12 +51,12 @@ long long xnarch_tsc_to_ns_rounded(long long ticks)
>>  {
>>         return (xnarch_llimd(ticks, 1000000000, cpufreq/2) + 1) / 2;
>>  }
>> -#endif /* !XNARCH_HAVE_LLMULSHFT */
>>
>>  long long xnarch_ns_to_tsc(long long ns)
>>  {
>>         return xnarch_llimd(ns, cpufreq, 1000000000);
>>  }
>> +#endif /* !XNARCH_HAVE_LLMULSHFT */
>>
>>  static inline void xnarch_init_timeconv(unsigned long long freq)
>>  {
>>
> 
> Now the latency is positive:
> 
> RTT|  00:01:46  (periodic user-mode task, 100 us period, priority 99)
> RTH|-----lat min|-----lat avg|-----lat max|-overrun|----lat best|---lat worst
> RTD|       2.021|       9.626|      28.016|       0|       1.564|      29.206

Much better.

-- 
					    Gilles.


      reply	other threads:[~2009-08-27 17:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-27 11:08 [Xenomai-help] Negative Latency results Peter Puchwein
2009-08-27 11:14 ` Gilles Chanteperdrix
2009-08-27 11:24   ` Peter Puchwein
2009-08-27 11:27     ` Gilles Chanteperdrix
2009-08-27 11:50       ` Christoph Permes
2009-08-27 12:05         ` Gilles Chanteperdrix
2009-08-27 12:33           ` Christoph Permes
2009-08-27 17:13             ` Gilles Chanteperdrix [this message]

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=4A96BED7.4030707@domain.hid \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=christoph.permes@domain.hid \
    --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.