[lkml]   [2004]   [May]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: MSEC_TO_JIFFIES is messed up...

* Davide Libenzi <> wrote:

> > why is it wrong?
> For HZ == 1000 it's fine, even if it'd better to explicitly make it HZ
> dependent and let the compiler to discard them.

the compiler cannot discard the multiplication and the division from the

x * 1000 / 1000

due to overflows. But we know that HZ is 1000 in the arch-dependent
param.h, and in sched.c we use the HZ dependent variant:

# define JIFFIES_TO_MSEC(x) ((x) * 1000 / HZ)
# define MSEC_TO_JIFFIES(x) ((x) * HZ / 1000)

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 14:03    [W:0.094 / U:9.628 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site