*BSD News Article 69969


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.mel.connect.com.au!munnari.OZ.AU!news.hawaii.edu!ames!news.larc.nasa.gov!lll-winken.llnl.gov!uwm.edu!chi-news.cic.net!nntp.coast.net!zombie.ncsc.mil!news.mathworks.com!newsfeed.internetmci.com!EU.net!usenet1.news.uk.psi.net!uknet!dispatch.news.demon.net!demon!arg1.demon.co.uk
From: Andrew Gordon <andrew.gordon@net-tel.co.uk>
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: MFS - Why?
Date: Sat, 01 Jun 1996 18:26:21 GMT
Lines: 37
Message-ID: <833653581.14697.0@arg1.demon.co.uk>
References: <AEn4jRr0u3@qsar.chem.msu.su> <npX7tgO@quack.kfu.com> <833457338.26209.0@arg1.demon.co.uk> <nqcignn@quack.kfu.com>
NNTP-Posting-Host: arg1.demon.co.uk
X-NNTP-Posting-Host: arg1.demon.co.uk
X-Mailer: Mozilla 1.1N (X11; I; FreeBSD 2.1-STABLE i386)
MIME-Version: 1.0
X-URL: news:nqcignn@quack.kfu.com
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=us-ascii

>>nsayer@quack.kfu.com (Nick Sayer) wrote:
>>>A lot of the time swap space is unused. Why? Because you have to plan
>>>for a maximum case, not an average case. Disk space you set aside for
>>>swap is therefore essentially wasted unless you spend a lot of time
>>>near maximal VM allocation. This is the one thing other OSes that have
>>>VM (win95, macos) have over Unix: they use unused disk space as swap
>>>transparently while Unix must have explicitly allocated swap 
>
>>You can use the vnode driver (see vnconfig(8)) to allow swapping into a
>>regular file.  It may not be quite as convenient as some other OSs,
>>but it certainly solves the problem.
>
>How? Once you add a swap area you can't remove it. So you can't
>prepare for a large job by adding temporary extra swap, do the work
>and then remove and dispose of this extra swap. That would be the
>only equivalent behavior. Solaris 2.x can do this, but FreeBSD can't.
>And in any case this behavior is not automatic.

That's what I meant by "less convenient"...

But a reboot is a hell of a lot less inconvenience than re-partitioning disks.
In any case, IIRC, MacOS also has the requirement to reboot for changes of swap
file to take effect [certainly it needs a reboot if it was turned off
altogether, and I think also for changes of size].

On the issue of "swapoff", on a 4.3BSD system I am familiar with it was
possible to "swapon" a vn file which was sparesly allocated (ie. not occupying
any disk blocks until data was written to it).  I don't know if this technique
works on FreeBSD, but if so it would seem to go some way towards what you want.
Mind you, that system also had swap area priorities, such that you could make
sure it used the "real" swap area in preference to the emergency-use-only vn
file.  This facility could also be used on workstations that had very small
disks to use a small amount of local swap as first choice, and to swap across
the network (like a netbooted station) when the local swap was exhausted.

I will do some more investigation as to what of this is applicable fo FreeBSD.