From 24c0a02a18d35dbd4f7715018bfffb11241bce7b Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Mon, 19 Nov 2018 01:07:43 +0100 Subject: 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. --- kern/thread.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'kern/thread.c') 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(); } -- cgit v1.2.3