bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH gnumach] kern: Use _irq variant of lock and disable interrupt


From: Samuel Thibault
Subject: Re: [PATCH gnumach] kern: Use _irq variant of lock and disable interrupts
Date: Fri, 23 Feb 2024 14:00:22 +0100
User-agent: NeoMutt/20170609 (1.8.3)

Applied, thanks!

Damien Zammit, le ven. 23 févr. 2024 08:09:55 +0000, a ecrit:
> During quantum adjustment, disable interrupts and call appropriate lock.
> ---
>  kern/priority.c  | 4 ++--
>  kern/processor.c | 2 +-
>  kern/processor.h | 2 +-
>  3 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/kern/priority.c b/kern/priority.c
> index fe11d0d4..7f28b3d7 100644
> --- a/kern/priority.c
> +++ b/kern/priority.c
> @@ -137,14 +137,14 @@ void thread_quantum_update(
>               if ((quantum != myprocessor->last_quantum) &&
>                   (pset->processor_count > 1)) {
>                       myprocessor->last_quantum = quantum;
> -                     simple_lock(&pset->quantum_adj_lock);
> +                     s = simple_lock_irq(&pset->quantum_adj_lock);
>                       quantum = min_quantum + (pset->quantum_adj_index *
>                               (quantum - min_quantum)) / 
>                                       (pset->processor_count - 1);
>                       if (++(pset->quantum_adj_index) >=
>                           pset->processor_count)
>                               pset->quantum_adj_index = 0;
> -                     simple_unlock(&pset->quantum_adj_lock);
> +                     simple_unlock_irq(s, &pset->quantum_adj_lock);
>               }
>  #endif       /* NCPUS > 1 */
>               if (myprocessor->quantum <= 0) {
> diff --git a/kern/processor.c b/kern/processor.c
> index 71bbb757..33733a59 100644
> --- a/kern/processor.c
> +++ b/kern/processor.c
> @@ -169,7 +169,7 @@ void pset_init(
>       pset->set_quantum = min_quantum;
>  #if  NCPUS > 1
>       pset->quantum_adj_index = 0;
> -     simple_lock_init(&pset->quantum_adj_lock);
> +     simple_lock_init_irq(&pset->quantum_adj_lock);
>  
>       for (i = 0; i <= NCPUS; i++) {
>           pset->machine_quantum[i] = min_quantum;
> diff --git a/kern/processor.h b/kern/processor.h
> index 747badf2..a562f80a 100644
> --- a/kern/processor.h
> +++ b/kern/processor.h
> @@ -77,7 +77,7 @@ struct processor_set {
>       int                     set_quantum;    /* current default quantum */
>  #if  NCPUS > 1
>       int                     quantum_adj_index; /* runtime quantum adj. */
> -     decl_simple_lock_data(, quantum_adj_lock)  /* lock for above */
> +     decl_simple_lock_irq_data(, quantum_adj_lock)  /* lock for above */
>       int                     machine_quantum[NCPUS+1]; /* ditto */
>  #endif       /* NCPUS > 1 */
>       long                    mach_factor;    /* mach_factor */
> -- 
> 2.43.0
> 
> 
> 

-- 
Samuel
---
Pour une évaluation indépendante, transparente et rigoureuse !
Je soutiens la Commission d'Évaluation de l'Inria.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]