Mikael Pettersson wrote: >Corey Minyard writes: > > +static int k7_watchdog_reset(int handled) > > +{ > > + unsigned int low, high; > > + int source; > > + > > + rdmsr(MSR_K7_PERFCTR0, low, high); > >Please use rdpmc() instead of rdmsr() when reading counter registers. >Ditto in the other places. >(I know oprofile doesn't, but that's no excuse.) > > > + /* > > + * If the timer has overflowed, this is certainly a watchdog > > + * source > > + */ > > + source = (low & (1 << 31)) == 0; > > + if (source) > >Why not "if ((int)low >= 0)"? > > Ok, new patch with these fixed. Tested on P6 and P4. I don't have a K7 to test on, but it's a pretty straightforward change. The "if ((int) low) >= 0" thing removed two pointless instructions on x86 (gcc 3.2). So much for gcc optimization on this one. Thanks for your help. -Corey