summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2018-11-19 00:58:00 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2018-11-19 00:58:00 +0100
commit2eec9a3688ab8a673a058312388cfff640acdd13 (patch)
treefee362298c73e0135cfc049d72c22a6c50a78caf
parentd1f39c38df5aee6df6661bcae2c2ca9f79428a8f (diff)
Drop SIMPLE_CLOCK support
This wasn't building and is not useful with nowaday's hardware. * configfrag.ac (SIMPLE_CLOCK): Do not define. * kern/sched.h [SIMPLE_CLOCK] (sched_usec): Remove variable declaration. * kern/sched_prim.c [SIMPLE_CLOCK] (sched_usec): Remove variable. [SIMPLE_CLOCK] (sched_init): Do not initialize sched_usec variable. [SIMPLE_CLOCK] (recompute_priorities): Do not tinker sched_usec variable. * kern/thread.c [SIMPLE_CLOCK] (thread_info): Do not ajust for clock drift.
-rw-r--r--configfrag.ac3
-rw-r--r--kern/sched.h9
-rw-r--r--kern/sched_prim.c20
-rw-r--r--kern/thread.c7
4 files changed, 0 insertions, 39 deletions
diff --git a/configfrag.ac b/configfrag.ac
index 3d7033ec..73c23ffb 100644
--- a/configfrag.ac
+++ b/configfrag.ac
@@ -103,9 +103,6 @@ AC_DEFINE([MACH_VM_DEBUG], [1], [MACH_VM_DEBUG])
# Mach-dep power conservation.
AC_DEFINE([POWER_SAVE], [1], [POWER_SAVE])
-# No hardware clock rollover.
-AC_DEFINE([SIMPLE_CLOCK], [0], [SIMPLE_CLOCK])
-
# Use statistical timing.
AC_DEFINE([STAT_TIME], [1], [STAT_TIME])
diff --git a/kern/sched.h b/kern/sched.h
index 8a4ec75b..588e0aa6 100644
--- a/kern/sched.h
+++ b/kern/sched.h
@@ -166,13 +166,4 @@ MACRO_BEGIN \
(thread)->processor_set->sched_load; \
MACRO_END
-#if SIMPLE_CLOCK
-/*
- * sched_usec is an exponential average of number of microseconds
- * in a second for clock drift compensation.
- */
-
-extern int sched_usec;
-#endif /* SIMPLE_CLOCK */
-
#endif /* _KERN_SCHED_H_ */
diff --git a/kern/sched_prim.c b/kern/sched_prim.c
index 423c6c0e..96fabf59 100644
--- a/kern/sched_prim.c
+++ b/kern/sched_prim.c
@@ -64,10 +64,6 @@ int min_quantum; /* defines max context switch rate */
unsigned sched_tick;
-#if SIMPLE_CLOCK
-int sched_usec;
-#endif /* SIMPLE_CLOCK */
-
thread_t sched_thread_id;
timer_elt_data_t recompute_priorities_timer;
@@ -159,9 +155,6 @@ void sched_init(void)
queue_init(&action_queue);
simple_lock_init(&action_lock);
sched_tick = 0;
-#if SIMPLE_CLOCK
- sched_usec = 0;
-#endif /* SIMPLE_CLOCK */
ast_init();
}
@@ -1089,21 +1082,8 @@ void compute_my_priority(
*/
void recompute_priorities(void *param)
{
-#if SIMPLE_CLOCK
- int new_usec;
-#endif /* SIMPLE_CLOCK */
-
sched_tick++; /* age usage one more time */
set_timeout(&recompute_priorities_timer, hz);
-#if SIMPLE_CLOCK
- /*
- * Compensate for clock drift. sched_usec is an
- * exponential average of the number of microseconds in
- * a second. It decays in the same fashion as cpu_usage.
- */
- new_usec = sched_usec_elapsed();
- sched_usec = (5*sched_usec + 3*new_usec)/8;
-#endif /* SIMPLE_CLOCK */
/*
* Wakeup scheduler thread.
*/
diff --git a/kern/thread.c b/kern/thread.c
index 8637e36f..29c26d44 100644
--- a/kern/thread.c
+++ b/kern/thread.c
@@ -1527,13 +1527,6 @@ kern_return_t thread_info(
basic_info->cpu_usage = thread->cpu_usage /
(TIMER_RATE/TH_USAGE_SCALE);
basic_info->cpu_usage = (basic_info->cpu_usage * 3) / 5;
-#if SIMPLE_CLOCK
- /*
- * Clock drift compensation.
- */
- basic_info->cpu_usage =
- (basic_info->cpu_usage * 1000000)/sched_usec;
-#endif /* SIMPLE_CLOCK */
flags = 0;
if (thread->state & TH_SWAPPED)