*BSD News Article 90656


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!news.rmit.EDU.AU!goanna.cs.rmit.edu.au!news.apana.org.au!cantor.edge.net.au!news.teragen.com.au!news.access.net.au!news.mel.connect.com.au!news.syd.connect.com.au!phaedrus.kralizec.net.au!news.mel.aone.net.au!grumpy.fl.net.au!news.webspan.net!newsfeeds.sol.net!news.ececs.uc.edu!newsxfer.itd.umich.edu!newsxfer3.itd.umich.edu!su-news-hub1.bbnplanet.com!news.bbnplanet.com!super.zippo.com!zdc!szdc!szdc-e!news
From: "John S. Dyson" <dyson@freebsd.org>
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: FreeBSD and copy-on-write fork
Date: Sat, 08 Mar 1997 13:09:55 -0500
Organization: John S. Dyson's home machine
Lines: 31
Message-ID: <3321AB73.41C67EA6@freebsd.org>
References: <5fqe8u$9fh@opus.anet-stl.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 3.01 (X11; I; FreeBSD 3.0-CURRENT i386)
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.freebsd.misc:36780

Jason Young wrote:
> 
> Does FreeBSD have any sort of implementation of or plans for a
> copy-on-write fork such as the one Linux uses? I know when Linux
> implemented this, it was rather controversial and can result in a speed
> hit in some cases.
> 
This question is interesting, but I am not sure that I quite understand
it (it could be some context that I am missing.)  FreeBSD does implement
COPY ON WRITE about as agressively as can be done.  Not only is the
.bss COW, but the .data is also.  Some OSes explicitly copy the .data
upon a fork operation (simplifies bookkeeping in some cases.)  However,
FreeBSD (esp. -current) is fairly conservative of memory in the case of
fork operations.

There is an issue regarding FreeBSD's usage of swap space.  We tend to
be a bit more agressive about pushing out pages that haven't been used
recently.  This choice is made because the cost of disk is much cheaper
than ram, and if the ram is populated with pages used more often, then
there is a performance increase.  (Systems that put-off pageout of
dirty,
but unused pages, oftentimes end up unnecessarily page against the .text
of running programs, and that is a perf hit.)

Let me know in a bit more detail about what you are asking, and I'll try
to either explain more about what FreeBSD does, or to make the changes
that will improve FreeBSD for your applications.

John
dyson@freebsd.org