Ksched preempts SCPs on schedule() calls
[akaros.git] / kern / src / kthread.c
index 0f0883c..0427704 100644 (file)
@@ -239,9 +239,10 @@ void __launch_kthread(struct trapframe *tf, uint32_t srcid, long a0, long a1,
                 * ROUTINE (which it is right now). */
                if (pcpui->owning_proc->state == PROC_RUNNING_S) {
                        spin_lock(&pcpui->owning_proc->proc_lock);
-                       /* Wrap up / yield the _S proc, which calls schedule_proc */
+                       /* Wrap up / yield the _S proc */
                        __proc_yield_s(pcpui->owning_proc, pcpui->cur_tf);
                        spin_unlock(&pcpui->owning_proc->proc_lock);
+                       schedule_scp(p);
                        abandon_core();
                        /* prob need to clear the owning proc?  this is some old shit, so
                         * don't just uncomment it. */