netdev
[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@elte.hu>
References: <20040512020700.6f6aa61f.akpm@osdl.org> <20040512181903.GG13421@kroah.com> <40A26FFA.4030701@pobox.com> <20040512193349.GA14936@elte.hu> <Pine.LNX.4.58.0405121247011.11950@bigblue.dev.mdolabs.com> <20040512200305.GA16078@elte.hu>
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)
#else
#define JIFFIES_TO_MSEC(x) ((x) * 1000 / HZ)
#endif

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

Attachment: pgpuASim9pErF.pgp
Description: PGP signature

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