On Fri, Jul 10, 2015 at 11:34:59AM +0200, Johann Obermayr wrote:
> Am 09.07.2015 um 17:51 schrieb Gilles Chanteperdrix:
> >On Thu, Jul 09, 2015 at 05:43:03PM +0200, Johann Obermayr wrote:
> >>Am 09.07.2015 um 16:19 schrieb Gilles Chanteperdrix:
> >>>On Thu, Jul 09, 2015 at 02:15:55PM +0200, Johann Obermayr wrote:
> >>>>Hello,
> >>>>
> >>>>we have follow situation
> >>>>
> >>>>u64 lrtdrv_time_of_irq_ns ;
> >>>>void worker_task()
> >>>>{
> >>>>while(1)
> >>>>     {
> >>>>     rtdm_task_sleep_abs(lrtdrv_time_of_irq_ns + 950000ull,
> >>>>RTDM_TIMERMODE_ABSOLUTE);
> >>>>     do_something();
> >>>>     }
> >>>>}
> >>>>
> >>>>_kernel_rtdm_irq_handler()
> >>>>{
> >>>>     lrtdrv_time_of_irq_ns = rtdm_clock_read_monotonic();
> >>>>}
> >>>>
> >>>>the  _kernel_irq_callback() is called every 1ms.
> >>>>we will , that the worker_task begin 50us before next irq
> >>>>
> >>>>But sometime, the worker task start ~50us after irq. Why ?
> >>>Best way to know, enable the I-pipe tracer, setup sufficient back
> >>>trace points, and when the wrong wake up happens, trigger an I-pipe
> >>>trace.
> >>>
> >>i will enable i-pipe tracer.
> >>found out, that
> >>
> >>rtdm_task_sleep_abs(xxx, RTDM_TIMERMODE_ABSOLUTE);
> >>u64 calc = rtdm_clock_read_monotonic();
> >>
> >>sometime the diff between xxx & calc is biger than 61000ns.
> >This is called "kernel task scheduling latency". It can be measured by
> >the latency -t 1 test.
> 
> Ok, i will test it with this test.
> Here a simple list of measure from  rtdm_task_sleep_abs(xxx) calc =
> rtdm_clock_read_monotonic

Yeah, latency -t 1 does that too. Only much better.

> >Are you sure that the tsc is synchronized on both cores (you did not
> >give us much information, in particular we do not know on what
> >hardware you have this issue).
> >
> tsc must be sync, because most time it is correct.

Bad reasoning. The time may be good when the interrupt happens on
the same core as the one where the waiting task is running, and bad
when both do not happen on the same cpu.

-- 
                                            Gilles.
https://click-hack.org

_______________________________________________
Xenomai mailing list
[email protected]
http://xenomai.org/mailman/listinfo/xenomai

Reply via email to