M port/portdat.h => port/portdat.h +2 -0
@@ 579,6 579,7 @@ struct Proc
Mach *mp; /* machine this process last ran on */
ulong affinity; /* affinity counter for that mach */
ulong movetime; /* ticks when proc was last reassigned */
+ ulong priority;
void *ureg; /* User registers for notes */
void *dbgreg; /* User registers for devproc */
@@ 689,3 690,4 @@ extern int mouseshifted;
extern int mousetype;
extern int mouseswap;
extern int nsyscall;
+extern Physseg physseg[];
M port/proc.c => port/proc.c +9 -5
@@ 22,7 22,7 @@ struct
}waitqalloc;
int nrdy;
-Schedq runhiq;
+Schedq runhiq; /* for hi priority process, don't bother with affinity */
char *statename[] =
{ /* BUG: generate automatically */
@@ 113,7 113,9 @@ ready(Proc *p)
s = splhi();
- if(p->state == Running)
+ if(p->priority)
+ rq = &runhiq;
+ else if(p->state == Running)
rq = &balance(p)->loq;
else
rq = &affinity(p)->hiq;
@@ 140,16 142,18 @@ runproc(void)
loop:
spllo();
- while(m->hiq.head == 0 && m->loq.head == 0)
+ while(runhiq.head == 0 && m->hiq.head == 0 && m->loq.head == 0)
;
splhi();
- if(m->hiq.head)
+ lock(&runhiq);
+ if(runhiq.head)
+ rq = &runhiq;
+ else if(m->hiq.head)
rq = &m->hiq;
else
rq = &m->loq;
- lock(&runhiq);
p = rq->head;
/* p->mach==0 only when process state is saved */
if(p == 0 || p->mach){
M port/sysproc.c => port/sysproc.c +5 -0
@@ 380,6 380,11 @@ sysexec(ulong *arg)
s->top = USTKTOP;
relocateseg(s, USTKTOP-TSTKTOP);
+ /*
+ * '/' processes are high priority (hack to make /ip more responsive)
+ */
+ if(devchar[tc->type] == L'/')
+ up->priority = 1;
close(tc);
/*