lkml.org 
[lkml]   [2004]   [Jul]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: preempt-timing-2.6.8-rc1
William Lee Irwin III wrote:
>>+ unsigned long preempt_exit
>>+ = (unsigned long)__builtin_return_address(0);
>>+ hold = sched_clock() - __get_cpu_var(preempt_timings) +
>>999999;
>>+ do_div(hold, 1000000);
>>+ if (preempt_thresh && hold > preempt_thresh &&
>>+ printk_ratelimit()) {

On Tue, Jul 13, 2004 at 10:51:24PM +1000, Nick Piggin wrote:
> This looks wrong. This means hold times of 1ns to 1000000ns trigger the
> exceeded 1ms threshold, 1000001 to 2000000 trigger the 2ms one, etc.
> Removing the + 999999 gives the correct result:
> 1000000 - 1999999ns triggers the 1ms threshold
> 2000000 - 2999999ns triggers the 2ms threshold
> etc
> Or have I missed something?

AFAICT this is nothing more than rounding up.


-- wli
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:04    [from the cache]
©2003-2011 Jasper Spaans