plan 9 kernel history: overview | file list | diff list

1994/0917/port/proc.c (diff list | history)

1994/0915/sys/src/9/port/proc.c:124,1421994/0917/sys/src/9/port/proc.c:124,147 (short | long | prev | next)
Use weighted average to compute run-time priorities.
rsc Mon Mar 20 18:31:47 2006
1994/0915    
	return nrdy && x >= up->priority; 
1994/0809    
} 
 
1994/0917    
enum 
{ 
	Squantum = (HZ+Nrq-1)/Nrq, 
}; 
 
1990/0227    
void 
ready(Proc *p) 
{ 
	int s; 
1994/0917    
	int s, pri; 
1993/0501    
	Schedq *rq; 
1990/0227    
 
	s = splhi(); 
1991/0501    
 
1994/0808    
	if(p->state == Running){ 
1994/0915    
		if(p->priority > 0) 
			p->priority--; 
1994/0808    
	} else 
		p->priority = p->basepri; 
1994/0917    
	if(p->state == Running) 
		p->rt++; 
	pri = p->basepri - (((p->art + p->rt)>>1)/Squantum); 
	if(pri < 0) 
		pri = 0; 
1994/0728    
	rq = &runq[p->priority]; 
1991/0420    
 
1994/0728    
	lock(runq); 
1994/0915/sys/src/9/port/proc.c:330,3351994/0917/sys/src/9/port/proc.c:335,342
1991/0807    
		dumpstack(); 
	} 
1993/0501    
	up->state = Wakeme; 
1994/0917    
	up->art = (up->art + up->rt)>>1; 
	up->rt = 0; 
1993/0501    
	r->p = up; 
1990/0227    
	unlock(r); 
} 


source code copyright © 1990-2005 Lucent Technologies; see license
Plan 9 distribution
comments to russ cox (rsc@swtch.com)