diff options
author | Damien Zammit <damien@zamaudio.com> | 2023-08-16 01:49:36 +0000 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-08-22 23:57:09 +0200 |
commit | dfc6fdaf69e0685280ea76a5da098197209ff1e0 (patch) | |
tree | 7729afedc2d68daf8cfddc3264f99b2a807dac95 /kern | |
parent | dd8df005220efb3425188b25c65e1281bb77d345 (diff) | |
download | gnumach-dfc6fdaf69e0685280ea76a5da098197209ff1e0.tar.gz gnumach-dfc6fdaf69e0685280ea76a5da098197209ff1e0.tar.bz2 gnumach-dfc6fdaf69e0685280ea76a5da098197209ff1e0.zip |
sched_prim.c: Check all run queues not just master processor
Message-Id: <20230816014835.2322718-6-damien@zamaudio.com>
Diffstat (limited to 'kern')
-rw-r--r-- | kern/sched_prim.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/kern/sched_prim.c b/kern/sched_prim.c index 11de69cf..6617db7c 100644 --- a/kern/sched_prim.c +++ b/kern/sched_prim.c @@ -49,6 +49,7 @@ #include <kern/queue.h> #include <kern/sched.h> #include <kern/sched_prim.h> +#include <kern/smp.h> #include <kern/syscall_subr.h> #include <kern/thread.h> #include <kern/thread_swap.h> @@ -1955,6 +1956,7 @@ void do_thread_scan(void) spl_t s; boolean_t restart_needed = 0; thread_t thread; + int i; #if MACH_HOST processor_set_t pset; #endif /* MACH_HOST */ @@ -1970,8 +1972,12 @@ void do_thread_scan(void) #else /* MACH_HOST */ restart_needed = do_runq_scan(&default_pset.runq); #endif /* MACH_HOST */ - if (!restart_needed) - restart_needed = do_runq_scan(&master_processor->runq); + if (!restart_needed) { + for (i = 0; i < smp_get_numcpus(); i++) { + if ((restart_needed = do_runq_scan(&cpu_to_processor(i)->runq))) + break; + } + } /* * Ok, we now have a collection of candidates -- fix them. |