[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 3/5 gnumach] sched_prim.c: Add missing MACH_HOST pset conditi
From: |
Samuel Thibault |
Subject: |
Re: [PATCH 3/5 gnumach] sched_prim.c: Add missing MACH_HOST pset conditionals |
Date: |
Tue, 22 Aug 2023 23:49:07 +0200 |
User-agent: |
NeoMutt/20170609 (1.8.3) |
AIUI in the !MACH_HOST case, myprocessor->processor_set is &default_pset
anyway? I'd rather keep the code simpler rather than micro-optimise
this.
Samuel
Damien Zammit, le mer. 16 août 2023 01:49:14 +0000, a ecrit:
> ---
> kern/sched_prim.c | 29 +++++++++++++++++++----------
> 1 file changed, 19 insertions(+), 10 deletions(-)
>
> diff --git a/kern/sched_prim.c b/kern/sched_prim.c
> index 5ee0791b..5def77d4 100644
> --- a/kern/sched_prim.c
> +++ b/kern/sched_prim.c
> @@ -510,6 +510,13 @@ static thread_t thread_select(
> processor_t myprocessor)
> {
> thread_t thread;
> + processor_set_t pset;
> +
> +#if MACH_HOST
> + pset = myprocessor->processor_set;
> +#else /* MACH_HOST */
> + pset = &default_pset;
> +#endif /* MACH_HOST */
>
> myprocessor->first_quantum = TRUE;
> /*
> @@ -520,13 +527,6 @@ static thread_t thread_select(
> thread = choose_thread(myprocessor);
> }
> else {
> - processor_set_t pset;
> -
> -#if MACH_HOST
> - pset = myprocessor->processor_set;
> -#else /* MACH_HOST */
> - pset = &default_pset;
> -#endif /* MACH_HOST */
> simple_lock(&pset->runq.lock);
> #if DEBUG
> checkrq(&pset->runq, "thread_select");
> @@ -1259,7 +1259,11 @@ void thread_setrun(
> /*
> * Not bound, any processor in the processor set is ok.
> */
> +#if MACH_HOST
> pset = th->processor_set;
> +#else
> + pset = &default_pset;
> +#endif /* MACH_HOST */
> #if HW_FOOTPRINT
> /*
> * But first check the last processor it ran on.
> @@ -1543,9 +1547,11 @@ thread_t choose_thread(
> /*NOTREACHED*/
> }
> simple_unlock(&runq->lock);
> -
> +#if MACH_HOST
> pset = myprocessor->processor_set;
> -
> +#else
> + pset = &default_pset;
> +#endif
> simple_lock(&pset->runq.lock);
> return choose_pset_thread(myprocessor,pset);
> }
> @@ -1752,8 +1758,11 @@ retry:
> }
> else if (state == PROCESSOR_IDLE) {
> processor_set_t pset;
> -
> +#if MACH_HOST
> pset = myprocessor->processor_set;
> +#else
> + pset = &default_pset;
> +#endif /* MACH_HOST */
> simple_lock(&pset->idle_lock);
> if (myprocessor->state != PROCESSOR_IDLE) {
> /*
> --
> 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
- [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
- Re: [PATCH 3/5 gnumach] sched_prim.c: Add missing MACH_HOST pset conditionals,
Samuel Thibault <=
- [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