[lkml]   [2013]   [Jul]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH v2 6/9] n_tty: Process echoes in blocks
On 07/23/2013 07:53 PM, Greg Kroah-Hartman wrote:
> On Sat, Jun 15, 2013 at 10:04:26AM -0400, Peter Hurley wrote:
>> Byte-by-byte echo output is painfully slow, requiring a lock/unlock
>> cycle for every input byte.
>> Instead, perform the echo output in blocks of 256 characters, and
>> at least once per flip buffer receive. Enough space is reserved in
>> the echo buffer to guarantee a full block can be saved without
>> overrunning the echo output. Overrun is prevented by discarding
>> the oldest echoes until enough space exists in the echo buffer
>> to receive at least a full block of new echoes.
> I'm a bit worried about this, I wonder if anything is expecting the
> echos to not come in "bursts" like this, but I really can't think of why
> they would want that.

The block size for echoes is trivially settable so if you'd prefer a
smaller value than every 256 chars, I could send a patch for a value
you are more comfortable with - 64 chars, 32 chars, whatever.

I picked that value from casual performance testing and that it
coincides with the smallest possible flip buffer; ie., echo blocks are
retired at the same rate as flip buffers when receiving is not

> So let's apply it and see what breaks! :)

I'm ready :)

Peter Hurley

 \ /
  Last update: 2013-07-25 03:41    [W:0.143 / U:3.804 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site