~kris/9p

9hist

0895365659e3318b8d2ce6c29a362b5378564f8d — David du Colombier 32 years ago 80b3616
Plan 9 from Bell Labs 1994-07-27
3 files changed, 16 insertions(+), 5 deletions(-)

M port/portdat.h
M port/proc.c
M port/sysproc.c
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);

	/*