diff options
author | Damien Zammit <damien@zamaudio.com> | 2024-02-23 08:09:55 +0000 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2024-02-23 14:00:17 +0100 |
commit | c5754fd61f08e8c1020cccbb9c7b875c33bd0a73 (patch) | |
tree | 107e26ba402bd11daa8cdadbececa4cbfaa440b0 /kern | |
parent | ef98db8f048cf7c70aaa0a16c76ac66954aad12e (diff) | |
download | gnumach-c5754fd61f08e8c1020cccbb9c7b875c33bd0a73.tar.gz gnumach-c5754fd61f08e8c1020cccbb9c7b875c33bd0a73.tar.bz2 gnumach-c5754fd61f08e8c1020cccbb9c7b875c33bd0a73.zip |
kern: Use _irq variant of lock and disable interrupts
During quantum adjustment, disable interrupts and call appropriate lock.
Message-ID: <20240223080948.457792-1-damien@zamaudio.com>
Diffstat (limited to 'kern')
-rw-r--r-- | kern/priority.c | 4 | ||||
-rw-r--r-- | kern/processor.c | 2 | ||||
-rw-r--r-- | 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 44315b87..0e42fa37 100644 --- a/kern/processor.c +++ b/kern/processor.c @@ -167,7 +167,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 */ |