lkml.org 
[lkml]   [1996]   [Nov]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: time warps, I despair

could you please try out this modified version of pentium_timer_interrput:

-------------------------------------------------->
static void pentium_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{
unsigned long long saved_timer_cc = 0;
/* code to identify LARGE interrupt delays ... testing only */

#define CPU_INTERNAL_SPEED_IN_MHZ 100
#define CYCLES_PER_JIFFY (CPU_INTERNAL_SPEED_IN_MHZ*1000000/HZ)

/* read Pentium cycle counter */
__asm__(".byte 0x0f,0x31"
:"=a" (last_timer_cc.low),
"=d" (last_timer_cc.high));

if ( last_timer_cc-saved_timer_cc > CYCLES_PER_JIFFY/3 )
printk("ayyee, IRQ delay bigger than 1/3 jiffy: %Lu.\n",
last_timer-saved_timer );

saved_timer_cc = last_timer_cc;
timer_interrupt(irq, NULL, regs);
}
<----------------------------------------------------

actually i havent even checked if it compiles. Note that you have to
define CPU_INTERNAL_SPEED_IN_MHZ 133 if you have a 133 MHz machine.

this code identifies lost jiffies >for sure<, provided that the lost
jiffy is 'casual', and not a systematic delay of timer interrupts. [the
latter could be only caused by pathetic load, which is not the case in
your situation].

Ingo

ps. printk-ing in the timer interrupt isnt exactly pretty, but we are
doomed at that point anyways, so the printk at least wont >cause< a lost
jiffy :)



\
 
 \ /
  Last update: 2005-03-22 13:37    [W:0.779 / U:0.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site