ts-7000
[Top] [All Lists]

Re: [ts-7000] TS-72xx Linux 2.4, tweaking scheduler tick

To:
Subject: Re: [ts-7000] TS-72xx Linux 2.4, tweaking scheduler tick
From: Dan Weese <>
Date: Sat, 17 Apr 2010 10:35:54 -0700


Chapter 14, Building Embedded Linux Systems, from previous link.

You'll need to understand the RT patch.

https://rt.wiki.kernel.org/index.php/Main_Page

On Sat, Apr 17, 2010 at 7:17 AM, scottamayo <> wrote:
 

My application would like to wake up 40 times a second and do some work. While I don't really need hard real time, I'd don't want a lot of drift, either.

On WinCE, which I'm more used to, the Sleep() call is accurate to 1ms, so it's not difficult to figure out how many ms away the next multiple of 25ms is, and sleep for just that many ms. I usually only have 1-3ms of work to do in any given cycle, so usually I'm passing 24 or 22 to Sleep(). It works reasonably well.

But the scheduler tick on Linux isn't generally 1ms - it sounds like 10ms is common. At 10ms, I'm worried that if I tell nanosleep() to nap for 23ms, it will only wake up after 30ms, and that's much too big a wobble.

What's the preferred technique to get reasonably precise (to the ms) wakeups in Linux? And, am I going to need to rebuild the kernel to change the HZ setting?

Note: I'm not excessively worried about efficiency. If I have to rebuild the kernel to set HZ to 1000, I won't be overjoyed, especially if it turns out that rebuilding the kernel is a big deal, but my app doesn't need a lot of CPU, so losing some CPU to fast ticking is acceptable.

Note - I'm planning to use FIFO scheduling at a high priority, 98 or so, for this thread.




__._,_.___


Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: =Email Delivery: Digest | m("yahoogroups.com?subject","ts-7000-fullfeatured");=Change Delivery Format: Fully Featured">Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | =Unsubscribe

__,_._,___
<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU