Fix CPU load balancer bugs, scheduling points support for remote CPUs
All checks were successful
Build documentation / build-and-deploy (push) Successful in 28s

This commit is contained in:
2026-02-05 23:44:32 +01:00
parent 5283787a80
commit 5fe9d0a158
19 changed files with 129 additions and 79 deletions

View File

@@ -9,7 +9,7 @@
#include <sys/spin_lock.h>
bool proc_sq_suspend (struct proc* proc, struct proc_suspension_q* sq, spin_lock_t* resource_lock,
spin_lock_ctx_t* ctxrl) {
spin_lock_ctx_t* ctxrl, struct cpu** reschedule_cpu) {
spin_lock_ctx_t ctxpr, ctxcpu, ctxsq;
struct cpu* cpu = proc->cpu;
@@ -48,10 +48,13 @@ bool proc_sq_suspend (struct proc* proc, struct proc_suspension_q* sq, spin_lock
spin_unlock (&proc->lock, &ctxpr);
spin_unlock (&cpu->lock, &ctxcpu);
*reschedule_cpu = cpu;
return PROC_NEED_RESCHEDULE;
}
bool proc_sq_resume (struct proc* proc, struct proc_sq_entry* sq_entry) {
bool proc_sq_resume (struct proc* proc, struct proc_sq_entry* sq_entry,
struct cpu** reschedule_cpu) {
spin_lock_ctx_t ctxsq, ctxpr, ctxcpu;
struct cpu* cpu = cpu_find_lightest ();
struct proc_suspension_q* sq = sq_entry->sq;
@@ -80,6 +83,8 @@ bool proc_sq_resume (struct proc* proc, struct proc_sq_entry* sq_entry) {
free (sq_entry);
*reschedule_cpu = cpu;
return PROC_NEED_RESCHEDULE;
}