From 1849bbb87d5c77d48b7f8600ac6c421b8dc05122 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Sun, 20 Mar 1994 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1994-03-20 --- port/proc.c | 12 ++++++------ port/qio.c | 7 ++++--- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/port/proc.c b/port/proc.c index dce1a462f1669d2e4e8c8b2c8cdce15f60bd90f2..5f4f155f5c923f651a99341b802a15b6b3f33afb 100644 --- a/port/proc.c +++ b/port/proc.c @@ -113,6 +113,12 @@ newcallback(void (*func)(void)) m->cbin = m->calls; } +int +anyready(void) +{ + return m->hiq.head != 0 || m->loq.head != 0; +} + void callbacks(void) { @@ -126,12 +132,6 @@ callbacks(void) } } -int -anyready(void) -{ - return m->hiq.head != 0 || m->loq.head != 0; -} - void ready(Proc *p) { diff --git a/port/qio.c b/port/qio.c index 7e55497b99fc9329816975df46061f056a2bfc0e..d81e49fe3bd735b85c9b501822b69a3a9042d81f 100644 --- a/port/qio.c +++ b/port/qio.c @@ -165,6 +165,8 @@ iallockproc(void *arg) else cl->goal += i; cl->wanted = 0; + if(cl->goal > 5000) + cl->goal = 5000; } first = 0; @@ -202,10 +204,9 @@ qinit(void) /* start with a bunch of initial blocks */ for(pow = Minpow; pow <= Maxpow; pow++){ cl = &arena.alloc[pow]; - cl->goal = 0; + cl->goal = 4; if(pow < 12) cl->goal = Maxpow-pow + 32; - cl->first = 0; for(; cl->have < cl->goal; cl->have++){ p = malloc(1<state & Qmsg)){ unlock(q); wakeup(&q->rr); - ifree(b); + free(b); splx(s); return i; }