Commit 5e883a38 authored by Stephen Hemminger's avatar Stephen Hemminger Committed by David S. Miller

[PKT_SCHED]: Use get_jiffies_64()

The packet scheduler simulates 64 bit jiffies on 32 bit platforms by running
a timer keeping a mark and and offset.  Since there is no locking and this is
racy and doesn't handle jiffie wrap real well.

We can use get_jiffies_64 on 2.6 do get what is needed.
The downside is the overhead of a function call, and a cache miss in
get_jiffies_64.
Signed-off-by: default avatarStephen Hemminger <shemminger@osdl.org>
Signed-off-by: default avatarDavid S. Miller <davem@redhat.com>
parent e560d2c3
......@@ -231,20 +231,7 @@ extern psched_time_t psched_time_base;
#define PSCHED_JSCALE 10
#endif
#if BITS_PER_LONG <= 32
#define PSCHED_WATCHER unsigned long
extern PSCHED_WATCHER psched_time_mark;
#define PSCHED_GET_TIME(stamp) ((stamp) = psched_time_base + (((unsigned long)(jiffies-psched_time_mark))<<PSCHED_JSCALE))
#else
#define PSCHED_GET_TIME(stamp) ((stamp) = (jiffies<<PSCHED_JSCALE))
#endif
#define PSCHED_GET_TIME(stamp) ((stamp) = (get_jiffies_64()<<PSCHED_JSCALE))
#define PSCHED_US2JIFFIE(delay) (((delay)+(1<<PSCHED_JSCALE)-1)>>PSCHED_JSCALE)
#define PSCHED_JIFFIE2US(delay) ((delay)<<PSCHED_JSCALE)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment