shithub: riscv

Download patch

ref: 7cf6a354866b3cf48ff3bd2544468a7f48994658
parent: 87d5626af038a5ab1df4f275beadd4415320d2aa
author: cinap_lenrek <[email protected]>
date: Mon Jun 23 16:29:10 EDT 2014

kernel: fix cooperative scheduling for wired processes

--- a/sys/src/9/port/proc.c
+++ b/sys/src/9/port/proc.c
@@ -425,7 +425,7 @@
 		return;
 	}
 
-	if(up != p)
+	if(up != p && (p->wired == nil || p->wired == MACHP(m->machno)))
 		m->readied = p;	/* group scheduling */
 
 	updatecpu(p);
@@ -511,6 +511,7 @@
 
 	/* cooperative scheduling until the clock ticks */
 	if((p=m->readied) && p->mach==0 && p->state==Ready
+	&& (p->wired == nil || p->wired == MACHP(m->machno))
 	&& runq[Nrq-1].head == nil && runq[Nrq-2].head == nil){
 		skipscheds++;
 		rq = &runq[p->priority];