irq: Add irq_tasks, move NVMe to it

This commit is contained in:
2026-10-30 00:21:36 +01:00
parent 49c454dd97
commit 829490f8c8
7 changed files with 107 additions and 55 deletions
+7
View File
@@ -84,6 +84,12 @@ void sched_init(struct scheduler* sched) {
// Asks the CPU of `sched` to reschedule as soon as it has interrupts enabled.
static void kick(struct scheduler* sched) {
if (sched == &percpu_get()->sched) {
sched->owe_preempt = true;
if (percpu_ref(irq_data)->depth == 0 && irq_get_state() && !sched->preempt_level && sched->current)
sched_reschedule(sched);
return;
}
if (!atomic_exchange(&sched->kick_pending, true, ATOMIC_RELAXED))
arch_sched_kick(cpu_of(sched));
}
@@ -217,6 +223,7 @@ static void finish_switch(struct task* prev) {
static void do_reschedule(struct scheduler* sched, uint64_t now) {
atomic_store(&sched->kick_pending, false, ATOMIC_RELAXED);
sched->owe_preempt = false;
struct task* from = sched->current;
struct task* to = next_task(sched, now);