diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2018-11-19 01:07:43 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2018-11-19 01:07:43 +0100 |
commit | 24c0a02a18d35dbd4f7715018bfffb11241bce7b (patch) | |
tree | 298e71ed490274aacb14a856ae86bdba721d3d67 /kern | |
parent | 2eec9a3688ab8a673a058312388cfff640acdd13 (diff) | |
download | gnumach-24c0a02a18d35dbd4f7715018bfffb11241bce7b.tar.gz gnumach-24c0a02a18d35dbd4f7715018bfffb11241bce7b.tar.bz2 gnumach-24c0a02a18d35dbd4f7715018bfffb11241bce7b.zip |
Fix task and thread collection frequency
sched_tick is incremented only once per second, not once per tick.
* kern/task.c (consider_task_collect): Divide task_collect_max_rate by
(hz / 1) to get a number of scheduler ticks.
* kern/thread.c (consider_thread_collect): Divide thread_collect_max_rate by
(hz / 1) to get a number of scheduler ticks.
Diffstat (limited to 'kern')
-rw-r--r-- | kern/task.c | 3 | ||||
-rw-r--r-- | kern/thread.c | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/kern/task.c b/kern/task.c index fc5802e3..57ad9849 100644 --- a/kern/task.c +++ b/kern/task.c @@ -1224,7 +1224,8 @@ void consider_task_collect(void) task_collect_max_rate = hz; if (task_collect_allowed && - (sched_tick > (task_collect_last_tick + task_collect_max_rate))) { + (sched_tick > (task_collect_last_tick + + task_collect_max_rate / (hz / 1)))) { task_collect_last_tick = sched_tick; task_collect_scan(); } diff --git a/kern/thread.c b/kern/thread.c index 29c26d44..86b76103 100644 --- a/kern/thread.c +++ b/kern/thread.c @@ -2326,7 +2326,8 @@ void consider_thread_collect(void) if (thread_collect_allowed && (sched_tick > - (thread_collect_last_tick + thread_collect_max_rate))) { + (thread_collect_last_tick + + thread_collect_max_rate / (hz / 1)))) { thread_collect_last_tick = sched_tick; thread_collect_scan(); } |