[Top] [All Lists]

Re: MSEC_TO_JIFFIES is messed up...

To: Ingo Molnar <mingo@xxxxxxx>
Subject: Re: MSEC_TO_JIFFIES is messed up...
From: Valdis.Kletnieks@xxxxxx
Date: Wed, 12 May 2004 16:18:17 -0400
Cc: Davide Libenzi <davidel@xxxxxxxxxxxxxxx>, Jeff Garzik <jgarzik@xxxxxxxxx>, Greg KH <greg@xxxxxxxxx>, Andrew Morton <akpm@xxxxxxxx>, Linux Kernel Mailing List <linux-kernel@xxxxxxxxxxxxxxx>, Netdev <netdev@xxxxxxxxxxx>
In-reply-to: Your message of "Wed, 12 May 2004 22:03:05 +0200." <20040512200305.GA16078@xxxxxxx>
References: <20040512020700.6f6aa61f.akpm@xxxxxxxx> <20040512181903.GG13421@xxxxxxxxx> <40A26FFA.4030701@xxxxxxxxx> <20040512193349.GA14936@xxxxxxx> <Pine.LNX.4.58.0405121247011.11950@xxxxxxxxxxxxxxxxxxxxxxx> <20040512200305.GA16078@xxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
On Wed, 12 May 2004 22:03:05 +0200, Ingo Molnar said:

> 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:

That should read   we "know" that HZ is 1000....

How about this instead?

#if HZ == 1000
#define JIFFIES_TO_MSEC(x)  (x)
#define JIFFIES_TO_MSEC(x) ((x) * 1000 / HZ)

That will DTRT if somebody changes HZ for their build, and still allow
us to avoud the *1000/1000 conversion for most builds.....

Attachment: pgpjVOR8IPsjH.pgp
Description: PGP signature

<Prev in Thread] Current Thread [Next in Thread>