From b66c4a6232489ede3bfe29b813d5fee0a66dc11f Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Fri, 25 Oct 2013 01:54:09 +0200 Subject: kernel: keep one closeproc arround in case we are unable to fork a new one closechanq() is unable to fork a new closeproc when palloc is locked. so we spawn a closeproc early in chandevinit() and make sure theres always one process arround to handle the queue. --- sys/src/9/port/chan.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/src/9/port/chan.c b/sys/src/9/port/chan.c index 6adb7f072..266c6f935 100644 --- a/sys/src/9/port/chan.c +++ b/sys/src/9/port/chan.c @@ -194,6 +194,8 @@ chandevreset(void) devtab[i]->reset(); } +static void closeproc(void*); + void chandevinit(void) { @@ -201,6 +203,7 @@ chandevinit(void) for(i=0; devtab[i] != nil; i++) devtab[i]->init(); + kproc("closeproc", closeproc, nil); } void @@ -506,6 +509,8 @@ closeproc(void*) c = clunkq.head; if(c == nil){ unlock(&clunkq.l); + if(canqlock(&clunkq.q)) + continue; pexit("no work", 1); } clunkq.head = c->next; -- cgit v1.2.3