[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/5 gnumach] sched_prim.c: Set quantum based on priority poli
From: |
Samuel Thibault |
Subject: |
Re: [PATCH 2/5 gnumach] sched_prim.c: Set quantum based on priority policy (not minimum) |
Date: |
Tue, 22 Aug 2023 23:43:34 +0200 |
User-agent: |
NeoMutt/20170609 (1.8.3) |
I don't think this is correct. Also see the computation
in thread_quantum_update, we need the attributed quantum
(myprocessor->quantum) to be min_quantum so as to correctly compute
between the available quantums of threads on the local processor queue
and on the pset queue.
Samuel
Damien Zammit, le mer. 16 août 2023 01:49:05 +0000, a ecrit:
> ---
> 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
>
>
>
--
Samuel
---
Pour une évaluation indépendante, transparente et rigoureuse !
Je soutiens la Commission d'Évaluation de l'Inria.
- [PATCH 0/5 gnumach] Scheduler fixes, Damien Zammit, 2023/08/15
- [PATCH 2/5 gnumach] sched_prim.c: Set quantum based on priority policy (not minimum), Damien Zammit, 2023/08/15
- Re: [PATCH 2/5 gnumach] sched_prim.c: Set quantum based on priority policy (not minimum),
Samuel Thibault <=
- [PATCH 1/5 gnumach] sched_prim.c: Split bound processor case into two, Damien Zammit, 2023/08/15
- [PATCH 3/5 gnumach] sched_prim.c: Add missing MACH_HOST pset conditionals, Damien Zammit, 2023/08/15
- [PATCH 4/5 gnumach] sched_prim.c: Lock thread when calling thread_setrun, Damien Zammit, 2023/08/15
- [PATCH 5/5 gnumach] sched_prim.c: Check all run queues not just master processor, Damien Zammit, 2023/08/15