summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustus Winter <justus@gnupg.org>2017-04-01 16:13:18 +0200
committerJustus Winter <justus@gnupg.org>2017-08-05 17:04:56 +0200
commit0d94b02b5e1d4857e8af8ceedfb2af467d7a0a2a (patch)
treea22cb67125a5d02da6e75de0bbf2a29be4c00f68
parentc327c0d2b9e9c8b813db99a6eb569786235b0bb2 (diff)
kern: Fix reporting the minimum quantum used for scheduling.
* kern/host.c (host_info): Scale 'min_quantum' by 'tick', then convert to milliseconds.
-rw-r--r--kern/host.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/kern/host.c b/kern/host.c
index 57280c49..3271b0cd 100644
--- a/kern/host.c
+++ b/kern/host.c
@@ -154,7 +154,7 @@ kern_return_t host_info(
{
host_sched_info_t sched_info;
extern int min_quantum;
- /* minimum quantum, in microseconds */
+ /* minimum quantum, in ticks */
/*
* Return scheduler information.
@@ -165,8 +165,9 @@ kern_return_t host_info(
sched_info = (host_sched_info_t) info;
sched_info->min_timeout = tick / 1000;
- sched_info->min_quantum = min_quantum / 1000;
/* convert microseconds to milliseconds */
+ sched_info->min_quantum = min_quantum * tick / 1000;
+ /* convert ticks to milliseconds */
*count = HOST_SCHED_INFO_COUNT;
return KERN_SUCCESS;