From 6e39dd45a42be2e9a6304ad901c0b158b5af35ed Mon Sep 17 00:00:00 2001 From: Max Wash Date: Sat, 21 Feb 2026 11:23:43 +0000 Subject: [PATCH] sched: only disable/enable interrupts if schedule() is called from non-IRQ context --- sched/core.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sched/core.c b/sched/core.c index 21d0fb4..dfe8a7d 100644 --- a/sched/core.c +++ b/sched/core.c @@ -91,7 +91,9 @@ void context_switch(struct thread *old, struct thread *new) void __schedule(enum sched_mode mode) { - ml_int_disable(); + if (mode != SCHED_IRQ) { + ml_int_disable(); + } struct cpu_data *this_cpu = get_this_cpu(); struct runqueue *rq = &this_cpu->c_rq; @@ -142,7 +144,9 @@ void __schedule(enum sched_mode mode) context_switch(prev, next); } - ml_int_enable(); + if (mode != SCHED_IRQ) { + ml_int_enable(); + } } void schedule(enum sched_mode mode)