Redesign scheduling points
All checks were successful
Build documentation / build-and-deploy (push) Successful in 35s

This commit is contained in:
2026-01-30 02:36:27 +01:00
parent d2f5c032d9
commit 124aa12f5b
9 changed files with 60 additions and 35 deletions

View File

@@ -8,7 +8,7 @@
#include <sys/smp.h>
#include <sys/spin_lock.h>
void proc_sq_suspend (struct proc* proc, struct proc_suspension_q* sq, spin_lock_t* resource_lock,
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 ctxpr, ctxcpu, ctxsq;
struct cpu* cpu = proc->cpu;
@@ -16,7 +16,7 @@ void proc_sq_suspend (struct proc* proc, struct proc_suspension_q* sq, spin_lock
struct proc_sq_entry* sq_entry = malloc (sizeof (*sq_entry));
if (!sq_entry) {
spin_unlock (resource_lock, ctxrl);
return;
return PROC_NO_RESCHEDULE;
}
sq_entry->proc = proc;
@@ -48,10 +48,10 @@ void proc_sq_suspend (struct proc* proc, struct proc_suspension_q* sq, spin_lock
spin_unlock (&proc->lock, &ctxpr);
spin_unlock (&cpu->lock, &ctxcpu);
cpu_request_sched (cpu);
return PROC_NEED_RESCHEDULE;
}
void 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) {
spin_lock_ctx_t ctxsq, ctxpr, ctxcpu;
struct cpu* cpu = cpu_find_lightest ();
struct proc_suspension_q* sq = sq_entry->sq;
@@ -80,7 +80,7 @@ void proc_sq_resume (struct proc* proc, struct proc_sq_entry* sq_entry) {
free (sq_entry);
cpu_request_sched (cpu);
return PROC_NEED_RESCHEDULE;
}
void proc_sqs_cleanup (struct proc* proc) {