From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9162fb4f61af163a X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-11-09 11:32:47 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!skynet.be!skynet.be!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Reduce scheduling interval on Linux... Date: 09 Nov 2002 19:32:51 +0000 Organization: Pushface Sender: simon@smaug.pushface.org Message-ID: References: NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1036870366 5800 62.49.19.209 (9 Nov 2002 19:32:46 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Sat, 9 Nov 2002 19:32:46 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 Xref: archiver1.google.com comp.lang.ada:30663 Date: 2002-11-09T19:32:51+00:00 List-Id: Peter writes: > On Red Hat linux a delay 0.0; would mean that process (thread) will be > out of processing for 10 (ms) by default. This is a kernel > configuration, and a good value in many cases. For my application I > would like to reduce this time to maybe 1 (ms), or try to optimise it > to the perfect value for the application. Yes, I know I am trying to > make a RTOS of something that is not, but this is really the only > thing missing, and the advantages of having a full system at least for > development makes me rather accept 10 (ms) that to have to cross > compile all the time. > > Has anyone been changing this and could point me in the right > direction. Tried to do this once on Red Hat 7.0....but only got > confused by the parameter names and the comments around them in the > kernel.... Are you aware of any other full systems, beeing it Linux, > BSD or whatever were this value is lower or easily could be changed ? I don't have the source installed at the moment, but on the 2.0 kernels you could change the tick time by altering include/asm/param.h to set HZ to 1000. I think you also have to change kernel/sched.c in sys_nanosleep() -- there's a busy wait for sleeps (as root) of 2 mS or less. Then (just) rebuild and go! We had machines that stayed up for (a few) weeks with this setting. NB1: if you have a loop with a delay, the maximum repetion rate you will get is half the jiffy frequency -- HZ=1000 gives 500 loops/sec. NB2: the real reason stock Linux isn't a RTOS isn't the 10 mS clock -- VxWorks has a 60 Hz clock out of the box -- rather, it's the unpredictability of kernel scheduling.