[60] in linux-announce channel archive

home help back first fref pref prev next nref lref last post

patch to swap to slower memory (e.g. expansion board)

daemon@ATHENA.MIT.EDU (Lars Wirzenius)
Sun Jan 1 10:11:06 1995

Date: Sun, 1 Jan 1995 16:14:04 +0200
From: Lars Wirzenius <wirzeniu@cc.helsinki.fi>
To: linux-activists@niksula.hut.fi, linux-announce@vger.rutgers.edu

X-Mn-Key: announce

From: David.H.West@um.cc.umich.edu
Subject: patch to swap to slower memory (e.g. expansion board)
Newsgroups: comp.os.linux.announce
Keywords: Linux, kernel, ramdisk, swapping, memory
Organization: ?
Approved: linux-announce@tc.cornell.edu (Lars Wirzenius)
Followup-to: comp.os.linux.development.system

I've uploaded ramdiskswap.tar.gz and ramdiskswap.lsm to 
sunsite.unc.edu:pub/Linux/Incoming.  This will likely speed up your system 
if it has both fast memory (on the motherboard) and slow memory (typically
on an expansion board).  Here's the README:
 
 - - - - - - ramdiskswap.README - - - - -
 
This tiny patch makes it possible to use the memory on expansion boards
as swap rather than as primary memory.  On my system (a 16MHz 386SX with
4M on the motherboard and 4M on an ISA expansion card), this makes CPU-bound 
tasks faster by a factor of almost 2 (measured) when lightly loaded, which
I expect to decrease to a factor of almost 4/3 when heavily loaded.
 
The patch moves the ramdisk to the top of memory, which is where expansion
board memory usually appears.  The example /etc/rc.d/rc.S file shows how
the (first) swapspace can be automatically initialized to be on the ramdisk
and of the correct size.  Before booting, you must have set the size of the 
ramdisk by using rdev on the zImage, and insured that /dev/ram is properly
set up; mine looks like: 
 
brw-rw----   1 root     disk       1,   1 Nov 30  1993 /dev/ram
 
The right size for the ramdisk is almost certainly the whole of the memory on 
the expansion board.  Even though running "free" immediately after login shows 
more than 0.5 MB of memory already in use, this will eventually be swapped out
if necessary, and one should therefore not reduce the size of the ramdisk by 
this amount.  The patch should be applied in /usr/src/linux.
 
This patch is against kernel version 1.0.9.  Even though I've successfully
compiled a kernel under it, I still consider it ALPHA, because 1) no-one else
has used this particular patch (though several people seem to have done
something similar without making it widely available), and 2) it's my first 
attempt at a kernel patch.  So I deny all responsibility for any havoc it may
wreak on your system.  Something like it may well work for later kernels, but
you're on your own.
 
NOTE: I use Bootlin, not LILO, so the patch itself hides the ramdisk memory 
from the rest of the kernel, which has two consequences: 1) it doesn't show up
in the "available" or "data" figures in the boot messages (but you'll see it
in the "RAMDISK" message); and 2) if you use LILO, after applying this patch 
you don't need to (and shouldn't) change any memory-size parameter passed to 
LILO, because the patched kernel needs to start out knowing about all of core. 
 
David West                                       David_H_West@um.cc.umich.edu
 
 - - - - - end of ramdiskswap.README - - - - -

--
Send submissions for comp.os.linux.announce to: linux-announce@news.ornl.gov
PLEASE remember Keywords: and a short description of the software.


home help back first fref pref prev next nref lref last post