Re: [PATCH] termios.3: Document line length in canonical mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Peter

On 18 February 2016 at 16:31, Peter Hurley <peter@xxxxxxxxxxxxxxxxxx> wrote:
> On 02/18/2016 03:25 AM, Michael Kerrisk (man-pages) wrote:
>> Hello Peter,
>>
>> On 02/17/2016 05:37 PM, Peter Hurley wrote:
[...]
>> Okay -- so how's this text?
>>
>>        In canonical mode:
>>        [...]
>>        * The maximum line length is 4096 chars (including the terminating
>>          newline character); lines longer than 4096 chars are  truncated.
>>          After  4095  characters,  input processing (e.g., ISIG and ECHO*
>>          processing) continues, but any input data after 4095  characters
>>          up  to (but not including) any terminating newline is discarded.
>>          This ensures that the terminal can  always  receive  more  input
>>          until at least one line can be read.
>
> Yeah, this seems fine.

Thanks for checking it.

>>>>> However, the noncanonical mode input buffer size may change in the near
>>>>> future.
>>>>
>>>> Can you say some more about that?
>>>
>>> At very high line rates and with ptys, the size of the read buffer becomes a
>>> bottleneck, while at the same time, an already-committed page of memory is
>>> going unused because of the page order allocation used by vm area allocator
>>> (where N_TTY data is stored).
>>>
>>> The change is non-trivial however, since the maximum read size returned
>>> by canonical mode cannot > 4096 bytes (because of the userspace assumptions
>>> I referred to earlier).
>>>
>>>> And what changed in 3.13 with respect to noncanonical mode, by the way?
>>>
>>> In 3.12, the entire tty input path was parallelized.
>>>
>>> So while data is being read by userspace, input processing continues
>>> concurrently, adding new data for userspace to read (the actual
>>> construct used is a lockless circular buffer). In non-canonical modes,
>>> the userspace copy is always performed twice -- first, from beginning of
>>> unread data (head) to the end of buffer and then, from the beginning of
>>> buffer to last unread data (tail).
>>>
>>> Since new data may be added to the circular buffer in parallel after the
>>> first user copy has been performed, it's possible to retrieve up to 8192
>>> bytes (assuming the user copy buffer is that large).
>>
>> Thanks for the info. Do you think this warrants any changes in the man page?
>
> I don't think so. The goal of most changes in tty is to improve reliability
> or performance w/o affecting userspace-observable behavior.

Okay.

Cheers,

Michael


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux