lkml.org 
[lkml]   [2008]   [Jun]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH][resubmit] x86: enable preemption in delay
>  static void delay_tsc(unsigned long loops)
> {
> - unsigned long bclock, now;
> + unsigned prev, prev_1, now;
> + unsigned left = loops;
> + unsigned prev_cpu, cpu;
> +
> + preempt_disable();
> + rdtscl(prev);


The unsigneds should be probably u64 and the rdtsc rdtscll.
Otherwise this will all overflow for longer waits on a very
fast systems (e.g. a 5Ghz system wraps 32bit in ~1.1 seconds)
Normally such delays shouldn't be that long, but why risk
overflow even in extreme cases?

-Andi


\
 
 \ /
  Last update: 2008-06-01 18:19    [W:0.083 / U:0.964 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site