Subject: Linux-Development Digest #921
From: Digestifier <Linux-Development-Request@senator-bedfellow.MIT.EDU>
To: Linux-Development@senator-bedfellow.MIT.EDU
Reply-To: Linux-Development@senator-bedfellow.MIT.EDU
Date:     Sat, 16 Jul 94 13:13:05 EDT

Linux-Development Digest #921, Volume #1         Sat, 16 Jul 94 13:13:05 EDT

Contents:
  Re: Linux Performance Enhance ? ("John E. Davis")
  Re: Info needed on hd.c (Mark Lord)
  Re: Linux Performance Enhance ? (Jim Balter)
  Re: Arcnet drivers anyone? I'll help! (sorta) (Kevin Burtch)
  Re: Linux Performance Enhance ? (Matthias Urlichs)
  Re: Using switch/case to jump into loops (Tim Smith)
  Re: Linux Performance Enhance ? (Tim Smith)
  Re: Using switch/case to jump into loops (Jim Balter)
  Re: Returning free'd memory (Rob Janssen)
  Re: Linux Performance Enhance ? (Rob Janssen)
  serious defect on linux (James Smith)
  Re: Returning free'd memory (Erik Troan)
  Cirrus Logic and kernel text modes (ddelsig@uoft02.utoledo.edu)
  Re: Memory crunch in 1.1.24? (Jose Carlos Benfati Verdasca dos Santos (kofuji))

----------------------------------------------------------------------------

From: davis@pacific.mps.ohio-state.edu ("John E. Davis")
Subject: Re: Linux Performance Enhance ?
Reply-To: davis@amy.tch.harvard.edu (John E. Davis)
Date: Sat, 16 Jul 1994 13:57:15 GMT

In article <jqbCt0tpM.MsK@netcom.com> jqb@netcom.com (Jim Balter) writes:
   Setting static what to zero will not fail, in the sense that Rob's
   original code failed, by not doing all three tests.  Having what be 0
   instead of 2 after failing all 5+ iterations of the loop is not much
   of a failure; it doesn't much matter what "what" is upon the next entry in
   that case.

In order to make this statement, you have made use of knowledge of the
calling routine.  Without that knowledge, setting what to zero is not right.
--
     _____________
#___/John E. Davis\_________________________________________________________
#
# internet: davis@amy.tch.harvard.edu
#   bitnet: davis@ohstpy
#   office: 617-735-6746
#

------------------------------

From: mlord@bnr.ca (Mark Lord)
Subject: Re: Info needed on hd.c
Date: 15 Jul 1994 18:19:19 GMT

In article <Cszq4B.8sH@serval.net.wsu.edu> hakimian@haney.eecs.wsu.edu writes:
>Who is the current "expert", "maintainer", etc of the
>
>/usr/linux/devices/block/hd.c (etc.)

Linus seems to be the official fellow, but he's not too active with it.

Two other folks are more active:  the maintainers of the atdisk2 package,
and the maintainer of the IDE Performance Package (me). 

>I am trying to understand the section that complains when it sees a disk with
>more than 16 heads.

I am currently working on a fix for the E-IDE bios problem
with "more than 16 heads".  Wanna help test it when it's ready?
Then email me.. maybe have a fix this weekend, if I don't play 
with my new PPP connection too much.  :)

>2) When Linux came up it thought the disk has a geometry with 16 heads. When I
>   don't use the translation this is what it should see. When I use the
>   translation it was complaining about it being 32 heads. When I remove the
>   check it then comes up and sees it as 16 heads. What is happening?
>
>Anyone have any suggestion on where to go from here?

The drive doesn't really have more than 16 heads, it's just the CMOS settings
from the BIOS make it look like it does, to reduce the number of apparent
cylinders to below 1024.  I'm changing hd.c to ask the drive for the real
geometry at boot time, and then to adjust what it sees in the partition table
based on the CMOS settings.. to keep things consistant.
-- 
mlord@bnr.ca    Mark Lord       BNR Ottawa,Canada       613-763-7482

------------------------------

From: jqb@netcom.com (Jim Balter)
Subject: Re: Linux Performance Enhance ?
Date: Sat, 16 Jul 1994 06:51:22 GMT

In article <DAVIS.94Jul15154703@pacific.mps.ohio-state.edu>,
John E. Davis <davis@amy.tch.harvard.edu> wrote:
>In article <jqbCsz4sC.I0r@netcom.com> jqb@netcom.com (Jim Balter) writes:
>  >In article <DAVIS.94Jul12144609@pacific.mps.ohio-state.edu>,
>  >John E. Davis <davis@amy.tch.harvard.edu> wrote:
>  >>
>  >>It is true that the two pieces of code are different.  However, even setting
>  >>`what' to zero and re-executing the loop will fail since `what' has been
>  >>declared static.  Here is the original code.  My suggested replacement
>  >>follows.
>
>  >You are hallucinating.  The fact that "what" is static is irrelevant.
>
>No. Look again.  The basic form of the code is this:
>
>   static int what = 0;
>   int i = 5;   
>   
>   switch (what)
>     {
>        label:
>        case 0:
>           if (some_condition) what = somthing;
>        case 1:
>           if (some_condition_1) what = somthing_else;
>        case 2:
>           if (some_condition_2) what = yet_somthing_else;
>     }
>   
>  if (i--) goto label;
>
>Suppose that what is 2 but some_condition fails during the 5 loops through the
>tests.  The fact that what has been declared static means that the next time
>the function is called, what will be 2 again.  Setting it to zero and looping
>back to the switch invalidates this.

Did you bother to read what I wrote?  Namely

JQB>The only effect of the auto_what is to prevent what from being changed to 0
JQB>upon "return 0".

Whereas you said

>It is true that the two pieces of code are different.  However, even setting
>`what' to zero and re-executing the loop will fail since `what' has been
>declared static.  Here is the original code.  My suggested replacement

Setting static what to zero will not fail, in the sense that Rob's
original code failed, by not doing all three tests.  Having what be 0
instead of 2 after failing all 5+ iterations of the loop is not much
of a failure; it doesn't much matter what "what" is upon the next entry in
that case.

>Perhaps this thread should be directed to comp.lang.c.newbie.  

As a former member of the ANSI C committee who has coded in C for 27 years,
I tend to concur.
-- 
<J Q B>

------------------------------

From: kburtch@pts.mot.com (Kevin Burtch)
Subject: Re: Arcnet drivers anyone? I'll help! (sorta)
Reply-To: kburtch@pts.mot.com
Date: Thu, 14 Jul 1994 17:59:29 GMT


I would not have posted this, except I've gotten a surprizing number of
responses from my original post on the subject. 


I am including two messages sent to me with permission from the sender:

> From csmith@cs.ubc.ca Tue Jul 12 23:04:19 1994
> Date: Tue, 12 Jul 1994 20:05:13 -0700
> 
>...
> A friend of mine has a couple of ARCNET cards, so he and I were 
> hopefully going to write a driver for them soon (this summer).
> Of course, I've been fairly busy at work, and then a lot of people
> are telling me that there's a lot of work to do (more than just writing
> a single driver)
> 
> ARCNET cards are Token Bus, so first the driver has to be written
> which will do the dirty work of using the network. The extra work
> comes in because ARCNET cards do not use the same addressing as
> regular Ethernet cards. Essentially this means that you have to add
> some code so that you can map IP addresses to the ARCNET addresses.
> 
> Sounds easy right? ..... Wrong!  This involves digging into the kernel
> IP level code, which in Linux means digging into some "dirty" code
> (for me anyway :) )
> 
> Code has to be written for ARP, IP, routing, etc. ... you name it ;P
> 
> The funny thing is, that when I mentioned on c.o.l.d before that I
> might be writing these, other people expressed interest in this being
> written. 
> 
> To make an already too long story short, I'll probably end up giving
> it a try, although I can't say (and won't promise :) ) when (or if)
> I'll get it done.
> 
> So, if you know *anything* that you think would help, please send me
> some email about it.
> 
> Judging by the response I've gotten, most people think it's a waste of
> time to get ARCNET cards (and they're probably right with Ethernet
> cards being less than $100). Many others think that ARCNET cards will
> not be around for very much longer (they're also probably right about
> that). 
> 
> On the other hand, there still seem to be a fair amount of people with
> ARCNET, so keep your eyes on c.o.l.d and c.o.l.a ... I might actually
> announce a working driver some time in the next 2 or 3 months.
> 
> 
> Please excuse my verbose reply :)
> 
> Chris.


> Date: Thu, 14 Jul 1994  0:08:33 UTC-0700
> From: Chris Smith <csmith@cs.ubc.ca>
> 
> Go ahead and post my name.
> 
> Maybe it will prompt some of the network "bigwigs" to reply
> to me and show me where I should start work.
> 
> I actually have the ARCNET manuals now. The driver itself will be
> a piece of cake; ARCNET cards do a lot of the work for you. The rest
> I'm trying to get a grasp on (routing, etc), but it seems like it
> shouldn't be too bad. Having Linux kernel sources helps :)
> 
> Chris.


Other people have given me some additional information, but I did not get
permission from them to include it here (I didn't ask) so I'll summarize:

While Ethernet can provide a 10Mbps data rate, Arcnet can only provide 2Mbps.
Arcnet does have several advantages over Ethernet... "nobody wants them" which
makes them very inexpensive and easy to get. They are rated for 600m point to
point without a hub, while 10base2 Ethernet is rated for 200m, and twisted pair
10baseT is less than that. Thick Ethernet is rated for 500m, but the cable is
quite expensive. Some Arcnet boards can be configured for longer packet delays
to allow even further distances, maybe as far as 1km.


So it looks as though the Arcnet cards may be fairly decent for a home/hobby
or small business installation. :)


To answer some of the other questions: I don't have these cards. I am only
trying to find out if I can use them before buying any. I won't see the
seller for another month. (the next local monthly computer swap meet)


I'm not up to the task of writing these drivers myself, which is the reason
for my original post. So please, don't ask me if it's done yet, as I'm not
working on it.  :^)

Thanks everyone for all of your interest! :^)

Later,
---
              ______
Let me know  /\_,--|)
if you like / /    (     Kevin Burtch            ,,
Scorpions  |_|       ______________.__         ,///  My buddies include:
as pets.   \ \___,--'       ___ `----'S     ,-' // 1 Giant Asian Forest Scorp.
            \/___|__       / /\\/\ ,^ /\   /   //  1 Emperor Scorpion (Mom)
                    `-----/-/--\\|/--Y L,-|   '/  19 Emperor Scorpion babies
                         / /  /      \/__,----'    2 yet to be identified
                         ` `  `        `-            (caught in S. Florida)




------------------------------

From: urlichs@smurf.noris.de (Matthias Urlichs)
Subject: Re: Linux Performance Enhance ?
Date: 16 Jul 1994 08:55:52 +0200

In comp.os.linux.development, article <CsyB3C.8ML@pe1chl.ampr.org>,
  pe1chl@rabo.nl writes:
> >> 
> >At least use a "do { } while(i--)" loop...  ;-)
> 
> But that is not the same...  at least it would have to be
> "do { } while(--i)" to get equivalent behaviour.
> 
Not in this case, 'cause the while() at the beginning is skipped when the
loop is entered via one of the switch labels. This is exactly the reason
why I want to move the while() to the end of the loop.

I wonder what Linus thinks about this argument.  ;-)

-- 
I hate babies.  They're so human.
        -- H. H. Munro (Saki) (1870-1916)
-- 
Matthias Urlichs        \ XLink-POP N|rnberg  | EMail: urlichs@smurf.noris.de
Schleiermacherstra_e 12  \  Unix+Linux+Mac    | Phone: ...please use email.
90491 N|rnberg (Germany)  \   Consulting+Networking+Programming+etc'ing     42

Click <A HREF="http://smurf.noris.de/~urlichs/finger">here</A>.

------------------------------

From: tzs@u.washington.edu (Tim Smith)
Subject: Re: Using switch/case to jump into loops
Date: 16 Jul 1994 07:16:52 GMT

Here's a cute one.  Suppose you've got two cases in a switch that have
some common code at the end:

        switch(x)
        {
        case 1:
                code for 1
                break;
        case 2:
                code for 2
                code common to 2 and 3
                break;
        case 3:
                code for 3
                code common to 2 and 3
                break;
        case 4:
                code for 4
                break;
        }

Someone once pointed out you can avoid duplicating the code common to 2 and
3:

        switch(x)
        {
        case 1:
                code for 1
                break;
        case 2:
                code for 2
                if ( 0 ) {
        case 3:
                code for 3
                }
                code common to 2 and 3
                break;
        case 4:
                code for 4
                break;
        }

I would never do this, of course, but it's nice to spring on people when
you want to make them throw up...
--Tim Smith

------------------------------

From: tzs@u.washington.edu (Tim Smith)
Subject: Re: Linux Performance Enhance ?
Date: 16 Jul 1994 07:25:45 GMT

In article <CsvDLF.tv@pell.com>, Orc <orc@pell.com> wrote:
>   You want to put a Duffs Device into the kernel?
>
>
>   Urk.

Every kernel should have at least one cute, ugly, elegant, disgusting,
wonderful, nauseating thing in it.  While nothing can really compare
to the place deep in the Unix scheduler circa V7 where there was
code like this:

        /* you are not expected to understand this */
        if ( setjmp(foo) && ! setjmp(bar) )

a Duffs Device is almost as good.  These give the kernel character.

--Tim Smith

------------------------------

From: jqb@netcom.com (Jim Balter)
Subject: Re: Using switch/case to jump into loops
Date: Sat, 16 Jul 1994 07:11:47 GMT

In article <1994Jul15.072517.11856@emc.rvt.com>,
Remco Treffkorn <remco@emc.rvt.com> wrote:
>Not to inflame anyone, but I think the mentality of avoiding "gotos" at 
>*any* price is what makes people shoot each other in ireland...
>
>Gotos are like alkohol: Ok in moderation, or, used by a responsible adult.

Few people realize that when Dijkstra wrote his famous "Gotos Considered
Harmful" paper, the FORTRAN if statement took a condition and three labels,
for < 0, = 0, and > 0.  And if you weren't writing in FORTRAN, you were writing
in assembler.  (While most code was written in COBOL, that wasn't considered
a subject of "serious" discussion.)  So *all* code was an unreadable tangle
of spaghetti.  But these are different times.  I avoid gotos *unless* their
avoidance makes the code less straightforward.  The main uses I find are
in conjunction with switch statements for doing state machines (Duff's Device
is a special case of that), for doing cleanup after errors (exceptions can
be used instead in languages that have them), and for breaking out of or
continuing outer loops (some languages directly support that).

>After having insulted most of the world,

Heck, they deserved it.
-- 
<J Q B>

------------------------------

From: rob@pe1chl.ampr.org (Rob Janssen)
Subject: Re: Returning free'd memory
Reply-To: pe1chl@rabo.nl
Date: Thu, 14 Jul 1994 21:54:36 GMT

In <graphix.774209621@spiff.cc.iastate.edu> graphix@iastate.edu (Kent A Vander Velden) writes:

>Are there any planed changes to the Linux kernel to actually completely give 
>the memory back to the system which was free'd by the program before the 
>program exits?

There are no changes needed in the Linux kernel for this.  It is a function
(not) performed by the C libraries.

Rob
-- 
=========================================================================
| Rob Janssen                | AMPRnet:   rob@pe1chl.ampr.org           |
| e-mail: pe1chl@rabo.nl     | AX.25 BBS: PE1CHL@PI8UTR.#UTR.NLD.EU     |
=========================================================================

------------------------------

From: rob@pe1chl.ampr.org (Rob Janssen)
Subject: Re: Linux Performance Enhance ?
Reply-To: pe1chl@rabo.nl
Date: Thu, 14 Jul 1994 22:00:26 GMT

In <1994Jul14.012452.5331@escape.widomaker.com> shendrix@escape.widomaker.com (Shannon Hendrix) writes:

>Rob Janssen (rob@pe1chl.ampr.org) wrote:

>: How is that?

>What feature did you code use that was not well known?

It seems that most people think that case labels are only allowed in the
first block beneath the switch statement.

Rob
-- 
=========================================================================
| Rob Janssen                | AMPRnet:   rob@pe1chl.ampr.org           |
| e-mail: pe1chl@rabo.nl     | AX.25 BBS: PE1CHL@PI8UTR.#UTR.NLD.EU     |
=========================================================================

------------------------------

From: smith@meishan.animal.uiuc.edu (James Smith)
Subject: serious defect on linux
Date: 14 Jul 1994 23:12:45 GMT

i just run 13,973 K code on linux with 16 mb ram
and it use swap memory.  The 1 minute cpu time
become 2 hr run time.   This is very serious defect
on swap memory.  Can anyone fix this?
my friend found that when use swap memory the result is
incorrect in previous kernel  but for 1.1.28 it work fine.
I don't test in .29 yet.
========================

------------------------------

From: ewt@merengue.unc.edu (Erik Troan)
Subject: Re: Returning free'd memory
Date: 15 Jul 1994 19:01:01 GMT

In article <1994Jul15.071425.11777@emc.rvt.com>,
Remco Treffkorn <remco@emc.rvt.com> wrote:
>
>This is a non issue, is it not? Do we have virtual memory? What have I missed?
>There is nothing to "fix" in the kernel, is there?
>Don't you get a bit tangled in 'semantics' (please! note the pun) here?
>

Yes, I have virtual memory - but virtual memory = slow memory - I don't
want my system using it unless it has to. It doesn't make sense for the
kernel to swap out freed memory to the hard drive. Since it has been
freed the program doesn't need it any more, so it can just be discarded.
Unfortunately, the kernel doesn't know that.

Erik

-- 
============================================================================
"I'm not like that -- except when I am" ewt@sunsite.unc.edu  = Erik Troan
                                        gr-ewt@druid.csc.ncsu.edu
    - Nora from "Pump up the Volume"    http://sunsite.unc.edu/ewt

------------------------------

From: ddelsig@uoft02.utoledo.edu
Subject: Cirrus Logic and kernel text modes
Date: Sat, 16 Jul 1994 05:51:35 GMT

Hi all,

     I've got a Cirrus Logic 5428 VLB video card, and I was wondering how I
might go about setting my kernel up to run it in 132x43 text mode.  I get no
option for this when presented with the LILO prompt -- all I get to choose
from is 80x28 and 80x50 -- but I know the card is able to run this mode.  Is 
there some documentation about how to add these things to my kernel (I've
already checked the Kernel Hacker's Guide), or would someone be able to
explain it to me, please?

Thanks for any information.

Dave 
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
```````````````````````````````````````````````````````````````````````````````
     _/_/_/_/     _/_/        _/_/   _/_/_/_/       David M. Del Signore
      _/    _/     _/_/    _/_/       _/    _/      University of Toledo
     _/     _/    _/ _/  _/ _/       _/     _/          Toledo, Ohio
    _/     _/    _/  _/_/  _/       _/     _/ 
   _/    _/     _/   _/   _/       _/    _/      ddelsig@uoft02.utoledo.edu
_/_/_/_/     _/_/        _/_/   _/_/_/_/      suprdave@esserv01.eng.utoledo.edu
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
```````````````````````````````````````````````````````````````````````````````


------------------------------

From: benfati@lsi.usp.br (Jose Carlos Benfati Verdasca dos Santos (kofuji))
Crossposted-To: comp.os.linux.admin
Subject: Re: Memory crunch in 1.1.24?
Date: 16 Jul 1994 15:22:12 GMT

Richard Whittaker (rwhittak@orion.docwhitehorse.doc.ca) wrote:
: Greetings from Whitehorse!

: I've got an AMD386-40DX with 8MB of RAM, and didn't notice until recently
: that Linux appears to only be looking at 4MB of the RAM that I have. Now, I
: believe this to be a recent event, because previously I've been able to use
: all 8Megs of RAM that I have installed. 

: Top reports my memory as being:

: Load Averages 3.07 3.07 3.06
: 44 processes: 43 sleeping, 1 running, 0 zombie, 0 stopped
: CPU states:  3.7% user,  0.0% nice, 13.9% system, 82.5% idle
: Mem:   4768K av,  4356K used,   412K free,  1460K shrd,   992 buff
: Swap:  8200K av,  4612K used,  3588K free

: The Kernel itself on bootup reports memory as being:

: <6>Memory: 4772k/8192k available (776k kernel code, 384k reserved, 2260k data)

: 2260k of data????

: Is this normal behaviour?..

Did you compile the kernel whith "kernel profiling"? If you can't compile, 
or just don't want, try booting whith one of the slackware kernels.

------------------------------


** FOR YOUR REFERENCE **

The service address, to which questions about the list itself and requests
to be added to or deleted from it should be directed, is:

    Internet: Linux-Development-Request@NEWS-DIGESTS.MIT.EDU

You can send mail to the entire list (and comp.os.linux.development) via:

    Internet: Linux-Development@NEWS-DIGESTS.MIT.EDU

Linux may be obtained via one of these FTP sites:
    nic.funet.fi				pub/OS/Linux
    tsx-11.mit.edu				pub/linux
    sunsite.unc.edu				pub/Linux

End of Linux-Development Digest
******************************
