~kris/9p

9hist

f4708cee467b0782e1c368734c62ff032aa24f6a — David du Colombier 28 years ago 1a05d55
Plan 9 from Bell Labs 1998-09-01
3 files changed, 35 insertions(+), 30 deletions(-)

M ip/tcp.c
M port/proc.c
M port/sysfile.c
M ip/tcp.c => ip/tcp.c +1 -1
@@ 1509,7 1509,7 @@ tcpoutput(Conv *s)
		sent = tcb->snd.ptr - tcb->snd.una;

		/* Don't send anything else until our SYN has been acked */
		if(sent != 0 && (tcb->flags & (SYNACK|FORCE)) == 0)
		if(tcb->snd.ptr != tcb->iss && (tcb->flags & SYNACK) == 0)
			break;

		/* Compute usable segment based on offered window and limit

M port/proc.c => port/proc.c +31 -28
@@ 186,9 186,9 @@ ready(Proc *p)
Proc*
runproc(void)
{
	int i;
	Schedq *rq;
	Schedq *rq, *xrq;
	Proc *p, *l;
	ulong rt;

loop:



@@ 198,41 198,44 @@ loop:
	 */
	spllo();
	for(;;){
		/*
		 *  get lowest priority process that this
		 *  processor can run given affinity constraints
		 *  and that hasn't run in a while
		 */
		if((m->fairness++ & 3) == 0){
		if((++(m->fairness) & 3) == 0){
			/*
			 *  once in a while, run process that's been waiting longest
			 *  regardless of movetime
			 */
			rt = 0xffffffff;
			xrq = nil;
			for(rq = runq; rq < &runq[Nrq]; rq++){
				p = rq->head;
				if(p == 0)
					continue;
				if(p->readytime < rt){
					xrq = rq;
					rt = p->readytime;
				}
			}
			if(xrq != nil){
				rq = xrq;
				p = rq->head;
				if(p != nil)
					p->movetime = 0;
			}
		} else {
			/*
			 *  get highest priority process that this
			 *  processor can run given affinity constraints
			 */
			for(rq = &runq[Nrq-1]; rq >= runq; rq--){
				p = rq->head;
				if(p == 0)
					continue;
				for(; p; p = p->rnext){
					if(p->mp != MACHP(m->machno))
					if(p->movetime >= m->ticks)
						continue;
					i = m->ticks - p->readytime;
					if(i >= 2*nrdy*p->art)
					if(p->mp == MACHP(m->machno)
					|| p->movetime < m->ticks)
						goto found;
				}
			}
		}

		/*
		 *  get highest priority process that this
		 *  processor can run given affinity constraints
		 */
		for(rq = &runq[Nrq-1]; rq >= runq; rq--){
			p = rq->head;
			if(p == 0)
				continue;
			for(; p; p = p->rnext){
				if(p->mp == MACHP(m->machno)
				|| p->movetime < m->ticks)
					goto found;
			}
		}
	}

found:

M port/sysfile.c => port/sysfile.c +3 -1
@@ 291,11 291,13 @@ unionread(Chan *c, void *va, long n)
	for(i = 0; mount != nil && i < c->uri; i++)
		mount = mount->next;

	for(;;) {
	while(mount != nil) {
		if(waserror()) {
			runlock(&m->lock);
			nexterror();
		}
		if(mount->to == nil)
			goto next;
		nc = cclone(mount->to, 0);
		poperror();