[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/5 gnumach] sched_prim.c: Set quantum based on priority policy (
From: |
Damien Zammit |
Subject: |
[PATCH 2/5 gnumach] sched_prim.c: Set quantum based on priority policy (not minimum) |
Date: |
Wed, 16 Aug 2023 01:49:05 +0000 |
---
kern/sched_prim.c | 21 ++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)
diff --git a/kern/sched_prim.c b/kern/sched_prim.c
index d69e4990..5ee0791b 100644
--- a/kern/sched_prim.c
+++ b/kern/sched_prim.c
@@ -518,7 +518,6 @@ static thread_t thread_select(
*/
if (myprocessor->runq.count > 0) {
thread = choose_thread(myprocessor);
- myprocessor->quantum = min_quantum;
}
else {
processor_set_t pset;
@@ -592,21 +591,21 @@ static thread_t thread_select(
simple_unlock(&pset->runq.lock);
}
}
+ }
#if MACH_FIXPRI
- if (thread->policy == POLICY_TIMESHARE) {
+ if (thread->policy == POLICY_TIMESHARE) {
#endif /* MACH_FIXPRI */
- myprocessor->quantum = pset->set_quantum;
+ myprocessor->quantum = pset->set_quantum;
#if MACH_FIXPRI
- }
- else {
- /*
- * POLICY_FIXEDPRI
- */
- myprocessor->quantum = thread->sched_data;
- }
-#endif /* MACH_FIXPRI */
}
+ else {
+ /*
+ * POLICY_FIXEDPRI
+ */
+ myprocessor->quantum = thread->sched_data;
+ }
+#endif /* MACH_FIXPRI */
return thread;
}
--
2.40.1