From owner-cvs-src@FreeBSD.ORG Sat Aug 30 09:19:40 2008 Return-Path: Delivered-To: cvs-src@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CBB151065676; Sat, 30 Aug 2008 09:19:40 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id B86F88FC27; Sat, 30 Aug 2008 09:19:40 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.2/8.14.2) with ESMTP id m7U9Je34004101; Sat, 30 Aug 2008 09:19:40 GMT (envelope-from ed@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.2/8.14.1/Submit) id m7U9JeUC004098; Sat, 30 Aug 2008 09:19:40 GMT (envelope-from ed@repoman.freebsd.org) Message-Id: <200808300919.m7U9JeUC004098@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to ed@repoman.freebsd.org using -f From: Ed Schouten Date: Sat, 30 Aug 2008 09:18:27 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/sys/kern tty.c tty_inq.c tty_outq.c src/sys/sys ttyqueue.h X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Aug 2008 09:19:40 -0000 ed 2008-08-30 09:18:27 UTC FreeBSD src repository Modified files: sys/kern tty.c tty_inq.c tty_outq.c sys/sys ttyqueue.h Log: SVN rev 182471 on 2008-08-30 09:18:27Z by ed Fix some edge cases in the TTY queues: - In the current design, when a TTY decreases its baud rate, it tries to shrink the queues. This may not always be possible, because it will not free any blocks that are still filled with data. Change the TTY queues to store a `quota' value as well, which means it will not free any blocks when changing the baud rate, but when placing blocks back into the queue. When the amount of blocks exceeds the quota, they get freed. It also fixes some edge cases, where TIOCSETA during read()/ write()-calls could actually make the queue a tiny bit bigger than in normal cases. - Don't leak blocks of memory when calling TIOCSETA when the device driver abandons the TTY while allocating memory. - Create ttyoutq_init() and ttyinq_init() to initialize the queues, instead of initializing them by hand. The new TTY snoop driver also creates an outq, so it's good to have a proper interface to do this. Obtained from: //depot/projects/mpsafetty/... Revision Changes Path 1.286 +10 -22 src/sys/kern/tty.c 1.2 +23 -42 src/sys/kern/tty_inq.c 1.3 +29 -42 src/sys/kern/tty_outq.c 1.2 +18 -0 src/sys/sys/ttyqueue.h