periodic issues/watchdog
So with rt_timer_set_periodic(125000) on and my sound task running, I still trip the watchdog. /proc/xenomai/stat is showing 9.5% usage by the sound task and a whopping 16.5% by IRQ0. (This amount seems considerably lower when watchdog support is not compiled in.) The weird thing is that the watchdog keeps killing the thread even though it isn't at all locking up the system. (ROOT using 82%.)
I changed my code to use this:
if(rt_task_wait_period(0)) rt_task_wait_period(0);
This was intended to catch the -ETIMEDOUT return value in case it did time out. I figure this maybe was causing the hard lockup I was seeing before.
Gilles's patch did work for me regarding the rt_timer_set_mode() problem.
It seems that for now, I'll have to disable the watchdog as I see this behavior with periodic mode or aperiodic mode. (My watchdog timeout is set for 1 second.)
Steven
Quoted 3 lines · Steven Seeger
It seems that for now, I'll have to disable the watchdog as I see this behavior with periodic mode or aperiodic mode. (My watchdog timeout is set for 1 second.)
What happens if you set the timeout to 2 seconds ?
Signature · 1 line
Gilles Chanteperdrix.
With the watchdog timeout set to 2 seconds, everything runs correctly both in periodic and aperiodic mode.
Is there an alternate way to sync all threads on a common timebase rather than periodic timing? I don't understand why periodic timing requires more CPU usage than aperiodic, when all it has to do is reset the interrupt. You'd think without calculations for absolute time expirations, it would be faster.
Steven
Quoted 9 lines
-----Original Message-----
From: Gilles Chanteperdrix [mailto:[email protected]]
Sent: Sunday, February 03, 2008 1:44 PM
To: Steven Seeger
Cc: [email protected]
Subject: Re: [Xenomai-help] periodic issues/watchdogQuoted 1 line · Steven Seeger
It seems that for now, I'll have to disable the watchdog as I see
this
Quoted 1 line
Quoted 1 line
behavior with periodic mode or aperiodic mode. (My watchdog timeout
is
Quoted 8 lines
Quoted 1 line
set for 1 second.)
What happens if you set the timeout to 2 seconds ?
--
Gilles Chanteperdrix.
Quoted 6 lines · Steven Seeger
So with
rt_timer_set_periodic(125000)on and my sound task running, I still trip the watchdog./proc/xenomai/statis showing 9.5% usage by the sound task and a whopping 16.5% by IRQ0. (This amount seems considerably lower when watchdog support is not compiled in.) The weird thing is that the watchdog keeps killing the thread even though it isn't at all locking up the system. (ROOT using 82%.)
What is your target arch, what is your time line for experiments? I'm expecting to work on the LTTng thing soon again, maybe this week, and that would be a good tool for all your periodic-timing-goes-crazy issues.
One further note regarding overhead: Timers (or timed tasks) running over a periodic timebase are expected to have a slightly higher overhead than running (at the same frequency) directly on the master (==one-shot) timebase. That's because the periodic timebase is built _on_top_ of the master base theses days (since Xenomai 2.4). So, unless you can benefit substantially from a jiffies/ticks based timing for your application (/wrt internal time calculations or due to the clustering of timer events), running directly on the master base is often the more efficient approach.
Jan
Quoted 3 lines
What is your target arch, what is your time line for experiments? I'm expecting to work on the LTTng thing soon again, maybe this week, and that would be a good tool for all your periodic-timing-goes-crazy
issues.
I'm running on x86 (geode... puke) and we I can help with experiments at least daily. I have removed periodic timing (for now) and also set the scalability stuff to linear, and am very happy with the result. I'm seeing about 6% of cpu usage in the IRQ0 handler under worst case. I don't trip the watchdog with the timeout set to 2 seconds like Gilles suggested.
Quoted 3 lines
One further note regarding overhead: Timers (or timed tasks) running over a periodic timebase are expected to have a slightly higher
overhead
Quoted 1 line
than running (at the same frequency) directly on the master
(==one-shot)
Quoted 1 line
timebase. That's because the periodic timebase is built _on_top_ of
the
Quoted 1 line
master base theses days (since Xenomai 2.4). So, unless you can
benefit
Quoted 3 lines
substantially from a jiffies/ticks based timing for your application (/wrt internal time calculations or due to the clustering of timer events), running directly on the master base is often the more
efficient
Quoted 1 line
approach.
I don't really need jiffies, but what I do want is there to be a common timebase for all my tasks in order to implement true RMS scheduling. I don't want things staggered on creation or after various delays are inserted into the system.
Thanks for your explanation about the timers, though. I am very happy with Xenomai's oneshot timer handling. I never could have had the system playing mp3s with a realtime sound driver and a DAC while controlling a stepper motor and handling user interaction with oneshot and RTAI (at least a few years ago.)
Steven