From owner-freebsd-commit Thu Dec 14 18:18:28 1995 Return-Path: owner-commit Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id SAA12906 for freebsd-commit-outgoing; Thu, 14 Dec 1995 18:18:28 -0800 (PST) Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id SAA12895 for cvs-all-outgoing; Thu, 14 Dec 1995 18:18:23 -0800 (PST) Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id SAA12885 for cvs-sys-outgoing; Thu, 14 Dec 1995 18:18:11 -0800 (PST) Received: (from bde@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id SAA12877 Thu, 14 Dec 1995 18:18:10 -0800 (PST) Date: Thu, 14 Dec 1995 18:18:10 -0800 (PST) From: Bruce Evans Message-Id: <199512150218.SAA12877@freefall.freebsd.org> To: CVS-committers, cvs-sys Subject: cvs commit: src/sys/kern tty.c Sender: owner-commit@FreeBSD.ORG Precedence: bulk bde 95/12/14 18:18:08 Modified: sys/kern tty.c Log: Changed the maximum output queue count from (TTMAXHIWAT + 200) to (TTMAXHIWAT + OBUFSIZ + 100) in case someone changes OBUFSIZ. 200 was to allow 100 above high water for ordinary writes and another 100 for kernel printfs. Increased the reserved output queue count from 512 to the maximum output queue count. This prevents exhaustion of clists and increases the output throughput for 8 cy lines by almost a factor of 2 (on a system where there aren't many other open ttys so clists become exhausted after about 4 active lines (or earlier if TTMAXHIWAT is increased :-]). ttwrite() behaves very badly when clists are exhausted: (1) it sleeps on lbolt instead of on TSA_OLOWAT(tp). This could be fixed adequately by sleeping on TSA_OLOWAT(tp). The nonzero reserved count guaratees that space will become available independent of other ttys, and a reserved count of 512 is barely enough for efficiency. (2) it drops output if space runs out in the middle of special output processing. This is too hard to fix without hardening the reserved count. The watermark processing guarantees that space doesn't run out only if the advertised space is guaranteed. Increasing the reserved output queue count defeats the point of dynamic allocation of clists. Previously, about 2K of memory per tty was reserved (the raw queue was already reserved). Now, about 3.5K is reserved. Reserving everything would take a whole 0.5K more. Revision Changes Path 1.77 +3 -2 src/sys/kern/tty.c