From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757533Ab0CKLaI (ORCPT ); Thu, 11 Mar 2010 06:30:08 -0500 Received: from lo.gmane.org ([80.91.229.12]:46191 "EHLO lo.gmane.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755278Ab0CKLaF (ORCPT ); Thu, 11 Mar 2010 06:30:05 -0500 X-Injected-Via-Gmane: http://gmane.org/ To: linux-kernel@vger.kernel.org From: Jef Driesen Subject: Low latency mode and performance of pty's? Date: Thu, 11 Mar 2010 12:24:24 +0100 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 143.169.49.29 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.8) Gecko/20100227 Lightning/1.0b1 Thunderbird/3.0.3 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, I have an application that uses a pair of pseudo terminals (using socat to link them together) to simulate a serial nullmodem cable. I use this setup to simulate the serial communication with an external device in my test environment. It works fine, but I noticed the performance is quite bad. You can reproduce the problem by running these commands in three different terminals: # Terminal 1: Setup the pty's. socat PTY,link=/tmp/ttyS0 PTY,link=/tmp/ttyS1 # Terminal 2: Send some data. dd if=/dev/urandom of=input.bin bs=538368 count=1 sx input.bin >>/tmp/ttyS0 /tmp/ttyS1 link->count != 1) goto out; + tty->low_latency = 1; + clear_bit(TTY_OTHER_CLOSED, &tty->link->flags); set_bit(TTY_THROTTLED, &tty->flags); retval = 0;