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.

Reply via email to