From owner-freebsd-current Thu Jun 5 23:31:31 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id XAA01375 for current-outgoing; Thu, 5 Jun 1997 23:31:31 -0700 (PDT) Received: from user2.inficad.com (straka@user2.inficad.com [207.19.74.4]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id XAA01370 for ; Thu, 5 Jun 1997 23:31:29 -0700 (PDT) Received: from localhost (straka@localhost) by user2.inficad.com (8.8.5/8.7.3) with SMTP id XAA11299; Thu, 5 Jun 1997 23:31:26 -0700 (MST) Date: Thu, 5 Jun 1997 23:31:25 -0700 (MST) From: Richard Straka To: Bruce Evans cc: current@freebsd.org Subject: Re: sio driver performance In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk I want to use FreeBSD (2.2.1-RELEASE) on a 486DX-33 to collect some serial data from some remote test equipment. As a precursor test, I have connected this box to another FreeBSD box and have been sending serial data back and forth. I have set both boxes serial ports as follows temp.c_lflag &= ~(ECHO | ICANON | IEXTEN | ISIG); temp.c_iflag &= ~(BRKINT | ICRNL | INPCK | ISTRIP | IXON); temp.c_cflag &= ~(CRTSCTS | CSIZE | PARENB); temp.c_cflag |= CS8; temp.c_oflag &= ~(OPOST); temp.c_cc[VMIN] = 1; temp.c_cc[VTIME] = 0; cfsetispeed(&temp,(speed_t)115200); cfsetospeed(&temp,(speed_t)115200); I have a small loop on one of the boxes which wakes up on a 100Hz alarm and send 16 bytes out the serial port. On the other box, I have a loop which continuously tries to read 16 bytes from the serial port. I have noticed that the communications work great until I interrupt the process on the box which is tranmitting the data. At that point, the box which was receiving suddenly elevates to 100% CPU usage (mostly system) as if in a polling loop. When I attempt to reestablish the process which is sending the data, I get "tty-level buffer overflows" on the receiving box, the read never unblocks and the CPU utilization stays at 100%. I have to kill the receiving process and restart it to reestablish communication. Also when the receive process is started, before the transmit process is started on the other box, the read seems to periodically return -1. Shouldn't the read indefinitely block if c_cc[VMIN]=1 and c_cc[VTIME]=0? The "tty-level buffer overflows" only occurs after the transmit process is started, then halted, then restarted. This could be a real problem for my remote test equipment as the serial lines may be inadvertently disconnected and reconnected from time to time. Any help with this would be greatly appreciated. Richard Straka straka@inficad.com