From: Peng Fan <van.freenix@gmail.com>
To: Philippe Gerum <rpm@xenomai.org>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai] xenomai cyclictest negative Max value
Date: Wed, 27 Dec 2017 08:49:58 +0800 [thread overview]
Message-ID: <20171227004958.GA28163@shlinux2> (raw)
In-Reply-To: <c51108d7-aa10-f721-60d6-9f0396ad75e7@xenomai.org>
On Wed, Dec 20, 2017 at 11:07:18AM +0100, Philippe Gerum wrote:
>On 12/20/2017 07:49 AM, Peng Fan wrote:
>> On Mon, Dec 18, 2017 at 10:26:28AM +0800, Peng Fan wrote:
>>> Hi All,
>>>
>>> I compiled xenomai-next on my ARM64 platform, but met Max and Avg not correct.
>>> See below:
>>>
>>> ./cyclictest -a -t10 -n -p99 -c 0
>>> # /dev/cpu_dma_latency set to 0us
>>> policy: fifo: loadavg: 0.97 0.51 0.21 1/135 3018
>>> policy: fifo: loadavg: 1.00 0.76 0.38 1/128 3018
>>> T:[ 200.650323] random: crng init done 0 Act: 0 Avg:443149053456561 Max: -1
>>> T: 0 ( 3002) P:99 I:1000 C: 373066 Min: 0 Act: 0 Avg:395570629834068 Max: -11
>>> T: 1 ( 3003) P:99 I:1500 C: 248710 Min: 0 Act: 0 Avg:148339383810136 Max: -111
>>> T: 2 ( 3004) P:99 I:2000 C: 186532 Min: 0 Act: 0 Avg:593359125738518 Max: -1
>>> T: 3 ( 3005) P:99 I:2500 C: 149359 Min: 0 Act: 0 Avg:123506076458128 Max: -11
>>> T: 4 ( 3006) P:99 I:3000 C: 124465 Min: 0 Act: 0 Avg:592833136181562 Max: -1
>>> T: 5 ( 3007) P:99 I:3500 C: 106684 Min: 0 Act: 0 Avg:172910127795260 Max: -111
>>> T: 6 ( 3008) P:99 I:4000 C: 93349 Min: 0 Act: 0 Avg:1383273613171719 Max: -1
>>> T: 7 ( 3009) P:99 I:4500 C: 82977 Min: 0 Act: 0 Avg:666934598998863 Max: -1
>>> T: 8 ( 3010) P:99 I:5000 C: 74679 Min: 0 Act: 0 Avg:988055226969271 Max: -11
>>>
>>> Seems xenomai cyclictest and rt-tests cyclictest is not sync, or there are
>>> some differecense. Could you please help me clarify what's the difference
>>> between xenomai cyclictest and rt-tests cyclictest? I did not find out which
>>> exact commit number when importing rt-tests cyclictest to xenomai.
>>
>> I add a debug info in cyclictest.c, see below:
>>
>> diff --git a/demo/posix/cyclictest/cyclictest.c b/demo/posix/cyclictest/cyclictest.c
>> index 31d9e5d0b..b16321cd9 100644
>> --- a/demo/posix/cyclictest/cyclictest.c
>> +++ b/demo/posix/cyclictest/cyclictest.c
>> @@ -920,6 +920,11 @@ void *timerthread(void *param)
>> diff = calcdiff_ns(now, next);
>> else
>> diff = calcdiff(now, next);
>> +
>> + if (diff == -1) {
>> + printf("==== %ld %ld %ld %ld\n", now.tv_sec, now.tv_nsec, next.tv_sec, next.tv_nsec);
>> + exit(0);
>> + }
>> if (diff < stat->min)
>> stat->min = diff;
>> if (diff > stat->max) {
>>
>> And I encounter the case that diff is -1,
>> "==== 16124 21743627 16124 21744638"
>> only 1ns difference between now and next.
>> This means clock_nanosleep wakeup earlier than expected?
>> I am using 4.9.51 kernel, and xenomai-next on ARM64. I am tracking
>> the hrtimer things, but no good progress. Please advise, if you any ideas.
>>
>
>You need to calibrate the core timer with the "autotune" utility. Some
>details available here:
>
>https://xenomai.org/documentation/xenomai-3/html/man1/autotune/index.html
I tried directly run "#autotune". It could fix the negative issue on i.mx6q and
i.mx7d. But on i.MX8 ARM64, I still could met the issue. Is there something
more that I could try?
Thanks,
Peng.
>
>--
>Philippe.
--
prev parent reply other threads:[~2017-12-27 0:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-18 2:26 [Xenomai] xenomai cyclictest negative Max value Peng Fan
2017-12-20 6:49 ` Peng Fan
2017-12-20 7:34 ` Peng Fan
2017-12-20 10:07 ` Philippe Gerum
2017-12-27 0:49 ` Peng Fan [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=20171227004958.GA28163@shlinux2 \
--to=van.freenix@gmail.com \
--cc=rpm@xenomai.org \
--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.