Message-ID: <4A96BED7.4030707@domain.hid> Date: Thu, 27 Aug 2009 19:13:59 +0200 From: Gilles Chanteperdrix MIME-Version: 1.0 References: <4A96692B.6070704@domain.hid> <4A966AA5.1050406@domain.hid> <4A966CDB.7060800@domain.hid> <4A966DB2.8030202@domain.hid> <1251373843.4321.30.camel@domain.hid> <4A9676A0.8010706@domain.hid> <1251376399.4321.44.camel@domain.hid> In-Reply-To: <1251376399.4321.44.camel@domain.hid> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Xenomai-help] Negative Latency results List-Id: Help regarding installation and common use of Xenomai List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christoph Permes Cc: xenomai@xenomai.org 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.