Re: MSEC_TO_JIFFIES is messed up...

From: Jeff Garzik
Date: Wed May 12 2004 - 15:49:06 EST

Andrew Morton wrote:
Jeff Garzik <jgarzik@xxxxxxxxx> wrote:

How about we do:

> > #if HZ=1000
> #define MSEC_TO_JIFFIES(msec) (msec)
> #define JIFFIES_TO_MESC(jiffies) (jiffies)
> #elif HZ=100
> #define MSEC_TO_JIFFIES(msec) (msec * 10)
> #define JIFFIES_TO_MESC(jiffies) (jiffies / 10)
> #else
> #define MSEC_TO_JIFFIES(msec) ((HZ * (msec) + 999) / 1000)
> #define JIFFIES_TO_MSEC(jiffies) ...
> #endif
> > in some kernel-wide header then kill off all the private implementations?

include/linux/time.h. One of the SCTP people already did this, but I suppose it's straightforward to reproduce.

OK, I'll do it.

Thanks. 'grep -i msec.*jif' and 'grep -i jif.*msec' should catch most, there are occurences in both upper and lower case.

Note that a few oddball drivers include an addition to the kernel-wide 'jiffies' variable, rather than just doing a calculation scaling against HZ.


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