LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   change default jiffy settings (https://www.linuxquestions.org/questions/linux-software-2/change-default-jiffy-settings-888325/)

junmuz 06-25-2011 10:31 AM

change default jiffy settings
 
Hello,

I have developed application in which I have used timer signal interrupts. The problem that I am getting is that these interrupts can occur up to minimum 4ms due to default jiffy settings. Can I lower this time in the order of us?

How can that be done?

macemoneta 06-26-2011 03:04 AM

On recent kernels in major distributions with recent hardware, you should see about 240us interrupt frequency (or better). Check here for information.

stanunruh 08-26-2011 12:10 PM

My kernel is version 2.6.23, and I am getting variable interrupt frequencies. The settings when I go to make menuconfig are 250 Hz, which is what I want. But if I run the code found at http://www.advenage.com/topics/linux...-frequency.php (referenced above) it tells me I have 126 Hz. My application, which is interrupt driven, runs anywhere from 125 to 250. There are a number of values I see, mainly 126, 135, 195, 223, and 250. When it runs at 250 it is very stable, but at the other values it always has a range of +/- about 5.

I have run my application on several other Linux operating systems, and it always runs rock steady at whatever the kernel is configured for. I have modified my include files to change HZ to 250 and am trying to recompile the kernel, but am having problems doing that (see another post I started today).

Does anyone know why the timer signal interrupts vary so much? The fact that it runs at 250 at times makes me think the settings in the kernel are probably set correctly. Has anyone experianced this variable phenomonen?

markseger 08-26-2011 04:54 PM

all I can say is I use perl::HiRes::Timer in collect to time things to usec and works just fine as far as I know across ALL platforms/distros since the 2.4 kernel days. Rock solid! Admittedly this is perl, but it's relying on underlying kernel services. Sounds to me like a bug in the timer you're using.
-mark

stanunruh 08-28-2011 03:39 PM

Mark, thanks for the advice. I understand I can use perl to sleep for an accurate period of time, or the return a very accurate time to the micro second, but how would I use it as an interval interrupt? I need to interrupt graphics and other file maintenance routines to service a robot every 4 milli seconds. Can you see perl working for this application? Would I need to multi-thread?


All times are GMT -5. The time now is 09:26 PM.