public inbox for linux-serial@vger.kernel.org
 help / color / mirror / Atom feed
From: Robert White <rwhite@pobox.com>
To: Andries Brouwer <aebr@win.tue.nl>
Cc: Russell King <rmk@arm.linux.org.uk>, Ed Vance <EdV@macrolink.com>,
	'Theodore Tso' <tytso@mit.edu>,
	linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org
Subject: Re: n_tty.c driver patch (semantic and performance correction) (a ll recent versions)
Date: Sat, 27 Jul 2002 19:34:27 -0700	[thread overview]
Message-ID: <200207271934.27102.rwhite@pobox.com> (raw)
In-Reply-To: <20020727232129.GA26742@win.tue.nl>

I don't have access to the truely official posix standards document (posix.org 
want's a login and ieee want's dues/subscriptions).  The manual page citation 
is common to linux and sun and was accessable to all readers, between the two 
of them, so I cited it.  Besides, I am citing back the same source as the 
quotes I was getting cited at me... 8-)

Blocking a system call for something that can't be used by the call is dumb.

Repeatedly changing the value of VMIN before each read (doubling your system 
calls/context switches) is dumb.

Having virtually every user on the planet realize this and just set VMIN == 1 
is an fairly telling indicator.

Repeatedly calling the kernel to assemble an input buffer which is necessary 
if VMIN ==1, is dumb.

Having an upper limit of 255 on the number of characters you can wait for in a 
single read, now that communications speeds are usefully large, is dumb.

The lay-programmers I have shown this too so far (a small and unprovable set, 
I know 8-) think blocking for the extra characters is an error.  This is the 
tried-and-true "rule of least astonishment".  It is "astonishing" to make a 
call read(fd,buffer,N), when you know N characters are already buffered, and 
not have it return because VMIN is bigger than N.

The fix for rounding down is one line and breaks nothing on the planet that 
anybody can find (mostly because of the default VMIN==1 everybody uses).

The rounding up part (adds one condition to the afore mentioned and one other 
conditional assignment) is more arguable but still quite a win since there 
isn't a modern serial protocol existant that uses a prefered maximum buffer 
size of less that 256 characters.

So far all I am getting back is one non-public "that's a good idea, but I want 
to see what everybody else thinks" and a bunch of "but the standard says"...

The standard is OLD and UNREALISTIC (and if you get all lawyer-ish, somewhat 
inconsitant and vague.) and the modification is one hundred percent 
compatable with what is in the field and what "more than half" of the users 
expect.

Rob.

On Saturday 27 July 2002 16:21, Andries Brouwer wrote:
> On Sat, Jul 27, 2002 at 03:07:56PM -0700, Robert White wrote:
> > I agree that that is what that line of the text says, my position is that
> > the entire statement was was written nieavely, and proveably so. 
> > Throughout the entire section the standard (not the linux manual page)
> > discusses "satisfying a read" (singular).  The text was written with an
> > "everybody will know basically what I mean" aditude that leaves it flawed
> > for strict
> > interpretation.  And the linux manual pages still show through enough to
> > use as the bases of my argument.
>
> I followed this discussion with half an eye, and do not really want
> to spend the time figuring out what my point of view would be.
>
> But.
>
> In such discussions the Linux man pages carry hardly any weight.
> Of interest are the original man pages of the system where the
> feature was introduced. And of interest is the original implementation.
> And of interest is the POSIX standard.
>
> Sometimes the POSIX author misunderstands something and writes some
> silly text into the standard. There are technical committees that
> one can approach and try to get a correction. Until such a time,
> one should read the POSIX text as written, and not as intended.
>
> Generally, Linux follows POSIX. That is good: since everybody else
> also does that, we can exchange programs. Everybody the same silliness
> has advantages over each his own correct solution.
>
> Sometimes, when following POSIX is too silly or too painful, Linux
> chooses its own way. But in such cases Linux does not follow the Linux
> man pages, it is just the other way around. So, I am afraid citing
> the Linux man pages will never give you a powerful argument.
>
> Andries
> aeb@cwi.nl
>
> [yes, I maintain the man pages; of course they are almost perfect,
> since few people have corrections; but corrections are always welcome]


  reply	other threads:[~2002-07-28  2:34 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-26 17:48 n_tty.c driver patch (semantic and performance correction) (a ll recent versions) Ed Vance
2002-06-26 20:42 ` Russell King
2002-06-27 16:37 ` Robert White
2002-07-26 14:17 ` Russell King
2002-07-27 22:07   ` Robert White
2002-07-27 23:11     ` Russell King
2002-07-27 23:21     ` Andries Brouwer
2002-07-28  2:34       ` Robert White [this message]
2002-07-28  3:01         ` Stevie O
2002-07-28 13:34         ` Andries Brouwer
2002-07-28 20:04         ` Alan Cox
     [not found]         ` <1027886676.790.5.camel@irongate.swansea.linux.org.uk>
2002-07-30  7:41           ` Robert White
2002-07-28  2:36       ` Robert White
  -- strict thread matches above, loose matches on Subject: below --
2002-07-31 16:58 Ed Vance
     [not found] <11E89240C407D311958800A0C9ACF7D13A7915@EXCHANGE>
2002-07-31  5:31 ` David Lawyer
2002-07-30 17:07 Ed Vance
2002-07-29 21:46 Ed Vance
2002-07-30  7:50 ` Robert White
2002-06-28 18:12 Ed Vance
2002-06-17 17:27 Ed Vance
2002-06-18  2:00 ` Robert White
     [not found] ` <200206171900.03955.rwhite@pobox.com>
2002-06-18 13:05   ` Stuart MacDonald

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200207271934.27102.rwhite@pobox.com \
    --to=rwhite@pobox.com \
    --cc=EdV@macrolink.com \
    --cc=aebr@win.tue.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=rmk@arm.linux.org.uk \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox