*BSD News Article 6692


Return to BSD News archive

Newsgroups: comp.unix.bsd
Path: sserve!manuel.anu.edu.au!munnari.oz.au!sgiblab!spool.mu.edu!agate!dog.ee.lbl.gov!hellgate.utah.edu!fcom.cc.utah.edu!cs.weber.edu!terry
From: terry@cs.weber.edu (A Wizard of Earth C)
Subject: Re: Adding Swapspace ??
Message-ID: <1992Oct18.082017.22382@fcom.cc.utah.edu>
Sender: news@fcom.cc.utah.edu
Organization: University of Utah Computer Center
References: <Bw7H4L.LLB@cosy.sbg.ac.at> <1992Oct16.162729.3701@ninja.zso.dec.com> <1992Oct16.201806.21519@fcom.cc.utah.edu> <Bw8Mw5.IFC@pix.com>
Date: Sun, 18 Oct 92 08:20:17 GMT
Lines: 74

In article <Bw8Mw5.IFC@pix.com>, stripes@pix.com (Josh Osborne) writes:
|> In article <1992Oct16.201806.21519@fcom.cc.utah.edu> terry@cs.weber.edu (A Wizard of Earth C) writes:
|> [...]
|> >And people wonder why I recommend putting the swap last, just before a
|> >DOS partition.  The reason is to allow you to back up your DOS (for which
|> >there is good, fast, reliable backup available, much as it pains me to say
|> 
|> What's wrong with the rdump, or tar cf - | rsh box.with.tape cat \>/dev/rst08?
|> Or getting a tape with a working driver...

It's less work to just put the swap last.

|> >What we really need is the ability to swap to a file (any file -- say an
|> >NFS mounted one, for instance) and get rid of the idea of a swap
|> >partition altogether.  Then you make a default swap file out of a
|> >bunch of contiguous file system blocks; if you let it grow, you pay
|> >for it being discontinuous then; at least you don't have to reinstall.
|> 
|>  You also pay for going through the filesystem, the obvious costs of
|> having to use the indirect blocks becuse FFS is optimised for SMALL
|> files, not big ones.  FFS will also limit how comtiguous your data
|> blocks can be, part of each cyl group is reserved for inodes, and your
|> swapfile is going to be large enough to cover scads of cyl groups.  I also
|> seem to remember something about the FFS not allowing a big file to fill
|> an entire cyl group, to allow the inodes in that cyl group to be close
|> to the data blocks FFS assumes you will someday want close to them (but
|> I am unsure of this part).

I think this was the pre 4.3 code, before the introduction of cluster groups;
in any case, the write to the disk is done through a write-through cache.  If
nothing else, you can certainly modify the allocation algorithm to make "swap"
a file type unto itself ...0160000 isn't taken yet.  The initial allocation
(done during create with an lseek() or ioctl() to the created fd) could take
care of it for you, getting arround the contiguity problem.  The majority of
interesting data should be in FS buffers off the vnode anyway.

|> You will (prob) also have the wrong inode
|> to data ratio.  I also don't think LSFS would be good for swaping on
|> either (but you could roll-back the swapfile :-).  You would still
|> want to be able to have >1 swap source so you can get multiple disks 
|> involved.

Actually, a Log Structred File System (Sprite, maybe?) could be useful if
memory was considered "write-through" to disk.  It's likely that everything
could be "resumed" after a crash right where the last valid transaction left
off.  This would be real nifty -- the power comes back on, vi comes back up
with the cursor in the same position and still in insert mode... 8-).

|>  That said, I think swaping on a file may be a good idea for (a) a stopgap
|> fix, and (b) it may make us design a filesystem that works well for
|> swap-like files, and (c) if you get a filesystem that does disk striping
|> wouldn't you want swap on it?  (Please don't try to put swap on a
|> auto-compressing filesystem 'tho)
|> 
|> Please find a better way to swap over the network then NFS 'tho...
|> (ND anyone?  RVD?)

TFTP?  8-P.  Actually, the idea of coming up totally diskless is *real*
attractive.  If you could get the boot to go on a single 1.2 Meg image, you
could actually load 386BSD and mount NFS drives for / and family from a
3.11 NetWare server with only the TCP/IP and NFS NLMs installed.


					Terry Lambert
					terry@icarus.weber.edu
					terry_lambert@novell.com
---
Any opinions in this posting are my own and not those of my present
or previous employers.
-- 
-------------------------------------------------------------------------------
                                        "I have an 8 user poetic license" - me
 Get the 386bsd FAQ from agate.berkeley.edu:/pub/386BSD/386bsd-0.1/unofficial
-------------------------------------------------------------------------------