linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mikulas Patocka <mikulas@artax.karlin.mff.cuni.cz>
To: Jeff Garzik <jgarzik@mandrakesoft.com>
Cc: Linux-Kernel <linux-kernel@vger.kernel.org>
Subject: The lack of specification (was Re: [LONG RANT] Re: Linux stifles innovation... )
Date: Mon, 19 Feb 2001 20:11:14 +0100 (CET)	[thread overview]
Message-ID: <Pine.LNX.3.96.1010219191533.6201A-100000@artax.karlin.mff.cuni.cz> (raw)
In-Reply-To: <Pine.LNX.3.96.1010219102055.17842O-100000@mandrakesoft.mandrakesoft.com>

> > > > I suspect part of the problem with commercial driver support on Linux is that
> > > > the Linux driver API (such as it is) is relatively poorly documented
> > > 
> > > In-kernel documentation, agreed.
> > > 
> > > _Linux Device Drivers_ is a good reference for 2.2 and below.
> > 
> > And do implementators of generic kernel functions and developers of device
> > drivers respect it? And how can they respect it if it's a commercial book?
> 
> _Linux Device Drivers_ documents the 2.2 (and previous) API, and
> thus refutes the argument that the kernel API is poorly documented.
> Since the publication of the book -succeeds- the publication of the
> APIs, your questions are not applicable.

What does it say about mark_buffer_dirty blocking or schedule and
TASK_[UN]INTERRUPTIBLE issues? If it says nothing, it is bad
documentation. If it says something, kernel developers do not respect it
and it is useless documentation...

> > > > and seems
> > > > to change almost on a week-by-week basis anyway. I've done my share of chasing
> > > > the current kernel revision with drivers that aren't part of the kernel tree:
> > > > by the time you update the driver to work with the current kernel revision,
> > > > there's a new one out, and the driver doesn't compile with it.
> > > 
> > > This is entirely in your imagination.  Driver APIs are stable across the
> > > stable series of kernels: 2.0.0 through 2.0.38, 2.2.0 through 2.2.18,
> > > 2.4.0 through whatever.
> > 
> > No true. Do you remember for example the mark_buffer_dirty change in some
> > 2.2.x that triggered ext2 directory corruption? (mark_buffer_dirty was
> > changed so that it could block). 
> > 
> > Another example of bug that comes from the lack of specification is
> > calling of get_free_pages by non-running processes that caused lockups on
> > all kernels < 2.2.15. And it is still not cleaned up - see tcp_recvmsg(). 
> > 
> > Having documentation could prevent this kind of bugs.
> 
> Hardly.

Imagine that there is specification of mark_buffer_dirty. That
specification says that
	1. it may not block
	2. it may block

In case 1. implementators wouldn't change it to block in stable kernel
	relese because they don't want to violate the specification.

In case 2. implementators of ext2 wouldn't assume that it doesn't block
	even if it doesn't in current implementation.

In both cases, the bug wouldn't be created.

> No documentation is often -better- than bad documentation.

Of course. But good documentation is better than no documentation :-)

> > You don't need too
> > long texts, just a brief description: "this function may be called from
> > process/bh/interrupt context, it may/may not block, it may/may not be
> > called in TASK_[UN]INTERURPTIBLE state, it may take these locks."
> > 
> > With documentation developers would be able to change implementation of
> > kernel functions without the need to recheck all drivers that use them. 
> 
> Anytime you change implementation, you gotta check all drivers that use
> them.  I know, I'm one of the grunts that does such reviews and changes.

Anytime you change implementation of syscalls, you gotta check all
applications that use them ;-) Luckily not - because there is
specification and you can check that syscalls conform to the
specification, not apps. 

> > Saying "code is the specification" is not good.
> 
> I'm not arguing against documentation.  That is dumb.  But the code is
> ALWAYS canonical.  Not docs.

Let's see:

There are parts of code (1) that set state to TASK_[UN]INTERRUPTIBLE and
then call some other complex functions, like page fault handlers. (for
example tcp in 2.2)

There are parts of code (2) that call schedule to yield the process
assuming that the state is TASK_RUNNING. (including some drivers) 

Sooner or later will happen, that subroutine called from part (1) get
somehow to part (2) and the process locks up.


Now implementators of TCP will say: that driver is buggy. Everybody should
set state=TASK_RUNNING before calling schedule to yield the process. 

Implementators of driver will say: TCP is buggy - no one should call my
driver in TASK_[UN]INTERRUPTIBLE state.

Who is right? If there is no specification....

Mikulas


  reply	other threads:[~2001-02-19 19:11 UTC|newest]

Thread overview: 148+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-02-15 17:49 Linux stifles innovation fsnchzjr
2001-02-15 17:55 ` Stephen Frost
2001-02-15 18:04 ` Mark Haney
2001-02-15 19:49   ` David D.W. Downey
2001-02-15 20:20     ` Alan Olsen
2001-02-15 20:42       ` dave
2001-02-15 21:17         ` Richard B. Johnson
2001-02-15 20:43       ` [OTP] " David D.W. Downey
2001-02-15 22:31       ` Bill Wendling
2001-02-15 22:37         ` William T Wilson
2001-02-16 12:45       ` Rik van Riel
2001-02-16 15:10         ` James Sutherland
2001-02-16 16:02           ` Mark Haney
2001-02-16 16:26             ` David Woodhouse
2001-02-16 16:30               ` Mark Haney
2001-02-16 19:23           ` David D.W. Downey
2001-02-16 20:18             ` James Sutherland
2001-02-17  0:03               ` Carlos Fernandez Sanz
2001-02-17  0:35                 ` Dan Hollis
2001-02-17  0:41                   ` Michael H. Warfield
2001-02-17  1:52                     ` Dan Hollis
2001-02-17  2:20                     ` XOR [ was: Linux stifles innovation... ] David Relson
2001-02-17  2:32                       ` Dan Hollis
2001-02-17  8:16                       ` Jonathan Morton
2001-02-17 13:16                       ` David Relson
2001-02-17 18:12                       ` brian
2001-02-18  2:01                         ` Dan Hollis
2001-02-17  9:08                     ` Linux stifles innovation James Sutherland
2001-02-17 12:45                     ` Henning P. Schmiedehausen
2001-02-17  9:05                 ` James Sutherland
2001-02-17  0:04     ` LA Walsh
2001-02-16  9:26 ` Helge Hafting
2001-02-16  9:36   ` James Sutherland
2001-02-16 12:44     ` Helge Hafting
2001-02-16 17:40     ` Joseph Pingenot
2001-02-16 14:25 ` Andrew Scott
2001-02-16 19:48   ` Jesse Pollard
2001-02-16 22:27   ` Dennis
2001-02-16 22:20     ` Alan Cox
2001-02-17 12:37       ` [LONG RANT] " Henning P. Schmiedehausen
2001-02-17 13:37         ` Russell King
2001-02-17 19:15           ` Henning P . Schmiedehausen
2001-02-17 22:03             ` Felix von Leitner
2001-02-18 11:54               ` Henning P. Schmiedehausen
2001-02-18 12:26                 ` Henning P. Schmiedehausen
2001-02-18 13:43                 ` Russell King
2001-02-18  9:27             ` Russell King
2001-02-17 19:20           ` Jacob Luna Lundberg
2001-02-18  1:06             ` Peter Samuelson
2001-02-18  4:15             ` Ben Ford
2001-02-17 18:48         ` Jonathan Morton
2001-02-19  9:24         ` Helge Hafting
2001-02-19 10:53         ` Werner Almesberger
2001-02-19 11:07           ` Jeff Garzik
2001-02-19 11:28             ` Nicholas Knight
2001-02-19 11:36               ` David Lang
2001-02-19 12:53                 ` Nicholas Knight
2001-02-19 11:47               ` Jeff Garzik
2001-02-19 12:57                 ` Nicholas Knight
2001-02-19 12:00             ` Werner Almesberger
2001-02-19 12:15             ` Henning P . Schmiedehausen
2001-02-19 16:04               ` Paul Jakma
2001-02-19 16:07               ` Alan Cox
2001-02-19 14:15             ` Jes Sorensen
2001-02-20 23:39             ` Brian May
2001-02-19 11:59           ` Henning P . Schmiedehausen
2001-02-19 13:11             ` Werner Almesberger
2001-02-19 14:07               ` David Howells
2001-02-19 14:55                 ` Jeff Garzik
2001-02-19 15:53                   ` Mikulas Patocka
2001-02-19 16:26                     ` Jeff Garzik
2001-02-19 19:11                       ` Mikulas Patocka [this message]
2001-02-19 20:02                         ` The lack of specification (was Re: [LONG RANT] Re: Linux stifles innovation... ) Eric W. Biederman
2001-02-19 20:17                         ` Albert D. Cahalan
2001-02-19 21:18                           ` Mikulas Patocka
2001-02-19 21:34                           ` The lack of specification Russell King
2001-02-19 21:47                             ` Eli Carter
2001-02-19 15:58                   ` [LONG RANT] Re: Linux stifles innovation Richard B. Johnson
2001-02-19 16:14                     ` Jeff Garzik
2001-02-19 16:26                     ` Alan Cox
2001-02-19 21:57                     ` Keith Owens
2001-02-19 19:27             ` Andre Hedrick
2001-02-17 16:54       ` Francois Romieu
2001-02-16 22:31     ` Dan Hollis
2001-02-16 22:51     ` David D.W. Downey
2001-02-16 22:59     ` Linux stifles innovation... [way O.T.] John Cavan
2001-02-16 23:07     ` Linux stifles innovation Mike A. Harris
2001-02-16 23:45       ` Matt D. Robinson
2001-02-16 23:46         ` Mike A. Harris
2001-02-17  0:15           ` Matt D. Robinson
2001-02-17  0:34             ` Werner Almesberger
2001-02-17  0:54               ` Matt D. Robinson
2001-02-17  1:58                 ` Werner Almesberger
2001-02-17 12:41       ` Henning P. Schmiedehausen
2001-02-17 17:51         ` Robert Read
     [not found]         ` <Pine.LNX.3.96.1010217145415.31128A-100000@orion.hq.dalalu.fr>
2001-02-17 18:40           ` Henning P . Schmiedehausen
2001-02-17  0:01     ` Alan Olsen
2001-02-17  0:10     ` rjd
2001-02-17  1:34     ` Neal Dias
2001-02-17  2:05     ` Augustin Vidovic
2001-02-17 12:46       ` Henning P. Schmiedehausen
2001-02-17 13:13         ` Roeland Th. Jansen
2001-02-21 23:00       ` Dr. Kelsey Hudson
2001-02-21 23:17         ` Augustin Vidovic
2001-02-22  1:08           ` Dr. Kelsey Hudson
2001-02-22  0:09       ` Jonathan Morton
2001-02-22  0:21         ` Alan Cox
2001-02-23 12:14         ` Wakko Warner
2001-02-23 12:31           ` David Weinehall
2001-02-27  8:48             ` Geert Uytterhoeven
2001-02-17  7:20     ` Mike Pontillo
2001-02-17 16:11       ` [OT]Re: " Gregory Maxwell
2001-02-17  7:39     ` Vesselin Atanasov
2001-02-17 19:08     ` Dennis
2001-02-17 19:08       ` Mohammad A. Haque
2001-02-17 20:47       ` Alan Cox
2001-02-24 21:11       ` Dennis
2001-02-24 21:06         ` Alan Cox
2001-02-17 19:11     ` Dennis
2001-02-17 19:36       ` Francois Romieu
2001-02-17 20:48       ` Alan Cox
2001-02-17 19:24     ` Dennis
2001-02-17 19:38     ` Dennis
2001-02-17 20:01       ` Michael Bacarella
2001-02-17 20:11         ` James A. Sutherland
2001-02-17 19:56     ` Linux stifles innovation... [way O.T.] Dennis
2001-02-17 20:28       ` Michael H. Warfield
2001-02-18 11:25         ` Henning P. Schmiedehausen
2001-02-18 15:32           ` John Cavan
2001-02-18  0:13       ` Gerhard Mack
2001-02-17 20:05     ` Linux stifles innovation Dennis
2001-02-17 20:05       ` James A. Sutherland
2001-02-17 20:14       ` Michael H. Warfield
2001-02-18 10:57         ` Henning P. Schmiedehausen
2001-02-17 20:28       ` Alan Olsen
2001-02-21 23:48         ` Dr. Kelsey Hudson
2001-02-17 22:07       ` Felix von Leitner
2001-02-17 20:08     ` Dennis
2001-02-17 20:22       ` Michael H. Warfield
2001-02-17 20:41       ` Gregory Maxwell
2001-02-18 10:59         ` Henning P. Schmiedehausen
2001-02-18 21:02           ` Bob Taylor
2001-02-17 22:38       ` Andre Hedrick
2001-02-17 23:07         ` Michael H. Warfield
2001-02-18 15:20       ` Stefan Smietanowski
2001-02-18  0:51     ` Peter Samuelson
2001-02-16 23:33   ` Hristo Doichev
2001-02-16 17:25 ` Byron Albert

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=Pine.LNX.3.96.1010219191533.6201A-100000@artax.karlin.mff.cuni.cz \
    --to=mikulas@artax.karlin.mff.cuni.cz \
    --cc=jgarzik@mandrakesoft.com \
    --cc=linux-kernel@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).