2001-03-26 06:29:51

by Eric S. Raymond

[permalink] [raw]
Subject: Re: CML1 cleanup patch

Peter Samuelson <[email protected]>:
> > CONFIG_8139TOO CONFIG_RTL8139TOO
> > CONFIG_8139TOO_PIO CONFIG_RTL8139TOO_PIO
> > CONFIG_8139TOO_TUNE_TWISTER CONFIG_RTL8139TOO_TUNE_TWISTER
>
> The -TOO suffix was to distinguish between this and the former 8139
> driver, as the two coexisted in 2.2 and 2.3. As the old driver has
> been dropped from 2.4, I propose likewise dropping the -TOO.

I'm preparing an updated version of the patch for 2.4.3-pre8. I'll
incorporate this change.

> Oh, BTW -- an alternate approach to making the kernel tree compatible
> with CML2 would be to make CML2 compatible with the kernel tree.
> Define a character (say '%') as an optional prefix for a configuration
> symbol. This character would only be required where the symbol would
> otherwise by misparsed, as with '[0-9].*'.

I considered two workarounds:

1. Adding some cruft to the language to support this case, as you suggest.

I might have gone this route, until I tripped over the two bugs and
the bad config symbols in the CRIS port tree. That meant there was
going to have to be a cleanup patch anyway, so why not fix those 20
symbols (out of 1831) rather than grubbifying the language?

2. Hacking the CML2 lexical analyzer to handle this case.

I could have done this, allowing tokens to be recognized as numeric only
if all chars are digits. I didn't, for two reasons: (1) Lexical analysis
is, as it turns out, a hotspot in the CML2 compiler code -- the last thing
it needs is more overhead, and (2) interpreting symbols with leading digits
as nonnumeric tokens is just *wrong*. Ugh. Violates the Principle of Least
Surprise big-time.
--
<a href="http://www.tuxedo.org/~esr/">Eric S. Raymond</a>

Every election is a sort of advance auction sale of stolen goods.
-- H.L. Mencken


2001-03-26 11:58:33

by John Cowan

[permalink] [raw]
Subject: Re: [kbuild-devel] Re: CML1 cleanup patch

esr scripsit:

> I could have done this, allowing tokens to be recognized as numeric only
> if all chars are digits. I didn't, for two reasons: (1) Lexical analysis
> is, as it turns out, a hotspot in the CML2 compiler code -- the last thing
> it needs is more overhead, and (2) interpreting symbols with leading digits
> as nonnumeric tokens is just *wrong*. Ugh. Violates the Principle of Least
> Surprise big-time.

In fact this has come up before: in Usenet software, which has to differentiate
between an article and a sub-newsgroup. An article has to have an all-numeric
name, and It Would Have Been Nice if all newsgroup names began with non-digits,
but then there was comp.bugs.4bsd.

--
John Cowan [email protected]
One art/there is/no less/no more/All things/to do/with sparks/galore
--Douglas Hofstadter

2001-03-26 15:35:32

by Rik van Riel

[permalink] [raw]
Subject: Re: [kbuild-devel] Re: CML1 cleanup patch

On Mon, 26 Mar 2001, John Cowan wrote:

> esr scripsit:
>
> > it needs is more overhead, and (2) interpreting symbols with leading digits
> > as nonnumeric tokens is just *wrong*. Ugh. Violates the Principle of Least
> > Surprise big-time.
>
> In fact this has come up before: in Usenet software, which has to
> differentiate between an article and a sub-newsgroup. An article has
> to have an all-numeric name, and It Would Have Been Nice if all
> newsgroup names began with non-digits, but then there was
> comp.bugs.4bsd.

What's wrong with using the _file type_ for these things ?

Conversely, why can't CML2 use the CONFIG_ prefix to
determine if a symbol is a configuration option, like
we're doing now?

Please do point out if I'm missing something, but I
really fail to see what the fuss is about.

regards,

Rik
--
Virtual memory is like a game you can't win;
However, without VM there's truly nothing to lose...

http://www.surriel.com/
http://www.conectiva.com/ http://distro.conectiva.com.br/

2001-03-26 17:52:23

by Eric S. Raymond

[permalink] [raw]
Subject: Re: [kbuild-devel] Re: CML1 cleanup patch

Rik van Riel <[email protected]>:
> What's wrong with using the _file type_ for these things ?

I don't understand that.

> Conversely, why can't CML2 use the CONFIG_ prefix to
> determine if a symbol is a configuration option, like
> we're doing now?

I do understand this. Greg Banks pointed it out last night, and I'm
testing a CML2 version that implements it now.
--
<a href="http://www.tuxedo.org/~esr/">Eric S. Raymond</a>

The two pillars of `political correctness' are,
a) willful ignorance, and
b) a steadfast refusal to face the truth
-- George MacDonald Fraser

2001-04-15 12:52:26

by kaih

[permalink] [raw]
Subject: Re: [kbuild-devel] Re: CML1 cleanup patch

Warning: No kernel related stuff inside.

[email protected] (Rik van Riel) wrote on 26.03.01 in <Pine.LNX.4.21.0103261153510.1863-100000@imladris.rielhome.conectiva>:

> On Mon, 26 Mar 2001, John Cowan wrote:

> > In fact this has come up before: in Usenet software, which has to
> > differentiate between an article and a sub-newsgroup. An article has
> > to have an all-numeric name, and It Would Have Been Nice if all
> > newsgroup names began with non-digits, but then there was
> > comp.bugs.4bsd.
>
> What's wrong with using the _file type_ for these things ?

Wrong problem description, really. The problem is not components starting
with digits, the problem is all-numeric components as in alt.2600.

And the problem is that this hits a fast path in the classical news spool
layout article create path. The code for this assumes that you have
articles in the range X to Y, and you just got a new article, so you write
a file called /var/spool/news/group/name/Y+1. You really do not want to
cope with the possibility of a directory Y+1 existing in that place.

I think there are some other things that also get impacted on their fast
path, but this is probably the most important.

And then, it's an ugly user interface: the classical spool layout does
assume that you look at that scpool with Unix tools (like find and grep),
not only via NNTP and the server.

MfG Kai

2001-04-15 21:33:26

by Olaf Titz

[permalink] [raw]
Subject: Re: [kbuild-devel] Re: CML1 cleanup patch

> And the problem is that this hits a fast path in the classical news spool
> layout article create path. The code for this assumes that you have
> articles in the range X to Y, and you just got a new article, so you write
> a file called /var/spool/news/group/name/Y+1. You really do not want to
> cope with the possibility of a directory Y+1 existing in that place.

C News did this, actually: if creat(.../name/Y+1) fails, it tries
creat(.../name/Y+2), etc. (IIRC up to 1000 times). This does not really
hurt a fast path: either you do
sprintf(a, "...", artno);
if (creat(a, ...)<0) {
syslog(...);
return FAILED;
}
or
while (sprintf(a, "...", artno),
creat(a, ...)<0) {
++artno;
if (++count>MAX) {
syslog(...);
return FAILED;
}
}

it's just one compare in the fast path which you need anyway.
(Initializing the counter does not _have_ to happen for each article.)

What would hurt is a stat() here, but that is not necessary. It could
be necessary in expire and/or maintenance tools, but these are not as
time-critical. The all-numerics mess up things like "find the lowest
article number" (makeactive/renumber/however it is called), in these
cases a stat is really necessary.

However I think the point is moot because the traditional spool layout
has been proven by experience to be inadequate for the job, even in
the face of more sophisticated filesystems - modern news systems need
other storage mechanisms to cope with the load anyway.

> And then, it's an ugly user interface: the classical spool layout does
> assume that you look at that scpool with Unix tools (like find and grep),
> not only via NNTP and the server.

INN needs a "storage manager grep", but that's even more off topic
here :-)

Olaf