aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2004-07-22 03:20:03 -0700
committerPatrick McHardy <kaber@trash.net>2004-07-22 03:20:03 -0700
commit0903b0161d488ebed601e66c0114814e9b092499 (patch)
treed7f82d05469801d37ec414177edf36ce34639ebb /net
parent9f56f64ccd3a71e381a927872833232a2f0945df (diff)
downloadhistory-0903b0161d488ebed601e66c0114814e9b092499.tar.gz
[PKT_SCHED]: Use get_cycles() for PSCHED_CPU clock source
Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@redhat.com>
Diffstat (limited to 'net')
-rw-r--r--net/sched/sch_api.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index c876d586b5ad42..fb7c4f0b81d1bf 100644
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -1109,25 +1109,27 @@ int psched_clock_scale;
EXPORT_SYMBOL(psched_clock_per_hz);
EXPORT_SYMBOL(psched_clock_scale);
-#ifdef PSCHED_WATCHER
psched_time_t psched_time_base;
-PSCHED_WATCHER psched_time_mark;
+cycles_t psched_time_mark;
EXPORT_SYMBOL(psched_time_mark);
EXPORT_SYMBOL(psched_time_base);
+/*
+ * Periodically adjust psched_time_base to avoid overflow
+ * with 32-bit get_cycles(). Safe up to 4GHz CPU.
+ */
static void psched_tick(unsigned long);
-
static struct timer_list psched_timer = TIMER_INITIALIZER(psched_tick, 0, 0);
static void psched_tick(unsigned long dummy)
{
- psched_time_t dummy_stamp;
- PSCHED_GET_TIME(dummy_stamp);
- /* It is OK up to 4GHz cpu */
- psched_timer.expires = jiffies + 1*HZ;
- add_timer(&psched_timer);
+ if (sizeof(cycles_t) == sizeof(u32)) {
+ psched_time_t dummy_stamp;
+ PSCHED_GET_TIME(dummy_stamp);
+ psched_timer.expires = jiffies + 1*HZ;
+ add_timer(&psched_timer);
+ }
}
-#endif
int __init psched_calibrate_clock(void)
{
@@ -1137,9 +1139,7 @@ int __init psched_calibrate_clock(void)
long rdelay;
unsigned long stop;
-#ifdef PSCHED_WATCHER
psched_tick(0);
-#endif
stop = jiffies + HZ/10;
PSCHED_GET_TIME(stamp);
do_gettimeofday(&tv);