Subject: Questions: swapping and panics, disk speed
To: None <amiga@NetBSD.ORG>
From: David Crooke <dcc@dcs.ed.ac.uk>
List: amiga
Date: 03/25/1995 22:29:42
My System:

   A3000/25, 2Mb Chip, 8Mb Fast, dodgy Buster (probably)
   PPI Mercury 68040/28, no RAM
   Quantum LPS 49Mb HDD, SCSI id 2, 1 partition = AmigaOS 49Mb
   Maxtor 7345S 330Mb HDD, SCSI id 6, 5 partitions = 
      AmigaOS 50Mb, NetBSD swap 32Mb, NetBSD /local 120Mb, NetBSD /usr 100Mb,
      NetBSD root 20Mb
   Wangtek 5150ES tape, SCSI id 4 (external)
   AmigaOS Kickstart 2.04 ROM, Workbench 2.04 with some extensions
   NetBSD 1.0 GENERIC kernel, fairly vanilla, all the usual.

Questions:

1. I am mounting the swap partition from /etc/fstab as /tmp - is this
OK?

2. Using "df /tmp" it only reports the amount of space used by /tmp
files, the rest is marked as free, irrespective of the amount of
(virtual) memory in use. Is this normal? What happens if it fills up
with files and there's no swap space?

3. The kernel seems over enthusiastic about swapping out to disk.
Using the report from top (figures approximate):

   Real: xxxx/6900K   Virtual: 21M/4296M     Free: 306K

The figure "xxxx" will drop down as low as 1Mb even with X11R6 running
with emacs 19, etc. etc. This is achieved by taking emacs down to a
working set of around 256K (from 1.9Mb) and so on, with the result
that whenever you do anything it has to page stuff back in from disk.
Why the !@#$%^&* won't it leave it in memory? It's worse than VMS! I
assume the "6900K" is the total RAM (for process memory etc.) after
the kernel has had its slice. Even with heavy use "xxxx" rarely
exceeds 2.5Mb, with the kernel preferring to swap/page everything in
sight at the slightest pretext.

I have experimented with forcing the issue, using a program written to
spray accesses through a large memory buffer in cyclic order, i.e. to
greedily grab a large working set. Running a bare multi-user system
and logging in on the text console I have managed to run it with a
buffer as large as 5.5Mb before the system descends into "page
thrashing". [ Interesting point - if the buffer goes over 4Mb the
process size jumps to 8Mb - is this a curious feature of malloc's
strategy? ]

I conclude that it has some policy of ageing pages which causes them
to be swapped prematurely if not used for a few seconds, or this is
being caused by a secondary issue like the kernel trying to get more
space for disk cacheing (repeated invocations of emacs start up
suspiciously quickly). Can I alter this easily, e.g. is another 4/8Mb
of RAM a magic elixir? If not, and if this is a general problem, is
this a project I can take on (no experience of kernel programming but
plenty of theoretical knowledge :) :)

Another subsidiary point - after 30-40 secs of thrashing with my test
program and an 8Mb size the system crashed, sic:

   panic: kernel jump to zero
   Stopped at 0x81428    unlk a6

Is this anything of note?

4. Disk access is very slow (not a NetBSD problem). I am making a new
SCSI cable for the internal bus and will shuffle the drive order. Will
that help? I have seen close to 2Mb/sec sustained from most of the
drives but the best on offer is around 500K/sec with the current setup
(correctly terminated). Comments?

5. On startup, NetBSD reports the Quantum as SCSI2 and the Maxtor as
SCSI1 - I am sure the reverse is true. Is this a known "minor
feature"? For what it's worth I think it says the tape drive is SCSI1
but I've personally no idea what it should be.

6. What do I need to do to make stuff binary-compatible with a Sun3
68020 running SunOS 4.0 ? A method to get static link binaries (no
ld.so) would do.

Thanks for your advice
Dave

David Crooke, Department of Computer Science, University of Edinburgh
Janet dcc@ed.dcs  :  Internet dcc@dcs.ed.ac.uk  :  IP talk dcc@129.215.160.29
JCMB Rm 1408, King's Bldgs, W. Mains Rd., Edinburgh EH9 3JZ. +44 131 650 5164
E.U. Motor Sport Club now on WWW - http://www.dcs.ed.ac.uk/home/dcc/EUMSC/