git: 9front

Download patch

ref: 181b949eff103e25aa5e8369c99a6cd0d83bf1dd
parent: 3bf0387b487c4b1e9c59364c694bdfcf9965e413
author: cinap_lenrek <cinap_lenrek@gmx.de>
date: Sun Jul 8 15:11:29 EDT 2012

qio: raise critical queue bloat threshold from 2 to 10 times to queue limit

the limit for overqueueing was too small for stuff like fcp
on a fileserver connected with a standard 32K limit pipe like
ramfs.

fcp usesd 8K*16procs > 32K*2

the biggest queue limit used in the kernel is 256K making
the maximum queue bloat 2.5MB or 320K for standard pipes.
that should be big enougth to never happen in practice
unless there is a bug which we like to catch before we
exhaust all kernel memory.

--- a/sys/src/9/port/qio.c
+++ b/sys/src/9/port/qio.c
@@ -1193,7 +1193,7 @@
 			poperror();
 			return n;
 		}
-		if(q->len >= q->limit*2){
+		if(q->len >= q->limit*10){
 			iunlock(q);
 			error(Egreg);
 		}
@@ -1241,7 +1241,7 @@
 	 *
 	 *  Note - this is moderately dangerous since a process
 	 *  that keeps getting interrupted and rewriting will
-	 *  queue infinite crud.
+	 *  queue up to 10 times the queue limit before failing.
 	 */
 	for(;;){
 		if(q->noblock || qnotfull(q))
--