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

This commit is contained in:
2026-02-18 23:16:03 +01:00
parent ae0a6024da
commit f103bdd739
39 changed files with 376 additions and 223 deletions

32
kernel/proc/reschedule.c Normal file
View File

@@ -0,0 +1,32 @@
#include <libk/list.h>
#include <mm/liballoc.h>
#include <proc/reschedule.h>
#include <sync/spin_lock.h>
#include <sys/smp.h>
void reschedule_list_append (struct reschedule_ctx* rctx, struct cpu* cpu) {
spin_lock (&rctx->lock);
struct list_node_link *node, *tmp;
list_foreach (rctx->entries, node, tmp) {
struct reschedule_entry* entry = list_entry (node, struct reschedule_entry, link);
if (entry->cpu == cpu) {
spin_unlock (&rctx->lock);
return;
}
}
struct reschedule_entry* entry = malloc (sizeof (*entry));
if (entry == NULL) {
spin_unlock (&rctx->lock);
return;
}
entry->cpu = cpu;
list_append (rctx->entries, &entry->link);
spin_unlock (&rctx->lock);
}