Redesign reschedule points, allow one operation to reschedule many cpus at once
All checks were successful
Build documentation / build-and-deploy (push) Successful in 2m12s
All checks were successful
Build documentation / build-and-deploy (push) Successful in 2m12s
This commit is contained in:
@@ -2,20 +2,21 @@
|
||||
#include <libk/std.h>
|
||||
#include <mm/liballoc.h>
|
||||
#include <proc/proc.h>
|
||||
#include <proc/reschedule.h>
|
||||
#include <proc/resource.h>
|
||||
#include <proc/suspension_q.h>
|
||||
#include <sync/spin_lock.h>
|
||||
#include <sys/smp.h>
|
||||
#include <sys/spin_lock.h>
|
||||
|
||||
bool proc_sq_suspend (struct proc* proc, struct proc_suspension_q* sq, spin_lock_t* resource_lock,
|
||||
struct cpu** reschedule_cpu) {
|
||||
void proc_sq_suspend (struct proc* proc, struct proc_suspension_q* sq, spin_lock_t* resource_lock,
|
||||
struct reschedule_ctx* rctx) {
|
||||
struct cpu* cpu = proc->cpu;
|
||||
|
||||
struct proc_sq_entry* sq_entry = malloc (sizeof (*sq_entry));
|
||||
if (!sq_entry) {
|
||||
spin_unlock (resource_lock);
|
||||
return PROC_NO_RESCHEDULE;
|
||||
return;
|
||||
}
|
||||
|
||||
sq_entry->proc = proc;
|
||||
@@ -47,13 +48,11 @@ bool proc_sq_suspend (struct proc* proc, struct proc_suspension_q* sq, spin_lock
|
||||
spin_unlock (&proc->lock);
|
||||
spin_unlock (&cpu->lock);
|
||||
|
||||
*reschedule_cpu = cpu;
|
||||
|
||||
return PROC_NEED_RESCHEDULE;
|
||||
reschedule_list_append (rctx, cpu);
|
||||
}
|
||||
|
||||
bool proc_sq_resume (struct proc* proc, struct proc_sq_entry* sq_entry,
|
||||
struct cpu** reschedule_cpu) {
|
||||
void proc_sq_resume (struct proc* proc, struct proc_sq_entry* sq_entry,
|
||||
struct reschedule_ctx* rctx) {
|
||||
struct cpu* cpu = cpu_find_lightest ();
|
||||
struct proc_suspension_q* sq = sq_entry->sq;
|
||||
|
||||
@@ -81,9 +80,7 @@ bool proc_sq_resume (struct proc* proc, struct proc_sq_entry* sq_entry,
|
||||
|
||||
free (sq_entry);
|
||||
|
||||
*reschedule_cpu = cpu;
|
||||
|
||||
return PROC_NEED_RESCHEDULE;
|
||||
reschedule_list_append (rctx, cpu);
|
||||
}
|
||||
|
||||
void proc_sqs_cleanup (struct proc* proc) {
|
||||
|
||||
Reference in New Issue
Block a user