*BSD News Article 13951


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!munnari.oz.au!spool.mu.edu!uwm.edu!cs.utexas.edu!geraldo.cc.utexas.edu!geraldo.cc.utexas.edu!usenet
From: vax@ccwf.cc.utexas.edu (Vax)
Newsgroups: comp.os.386bsd.development
Subject: Re: File Truncation Philosophy
Date: 3 Apr 1993 10:08:04 GMT
Organization: The University of Texas at Austin, Austin TX
Lines: 37
Message-ID: <1pjnm4INNjev@geraldo.cc.utexas.edu>
References: <C4tJ6C.C17@ns1.nodak.edu> <1pfteb$ch5@umd5.umd.edu>
NNTP-Posting-Host: sylvester.cc.utexas.edu

In article <1pfteb$ch5@umd5.umd.edu> mark@roissy.umd.edu (Mark Sienkiewicz) writes:
>
>Idea 4: Copy the program text into the swap area
>	4c- when the program file is opened for writing.  You would have
>		to block the open until the copy was complete.
>
To my untrained eye, this appears to be the Right Thing to do.
Executing a file basically means (to me and most newbies, i'd think) -
"use the code that is in this file right now, and run it".
This is my first reaction, and probably what I thought before I ever
knew about VM.
Now, the most simple way would be to copy the program immediately into swap,
but that's not as efficient as 4c.
To me, there is NOTHING intuitive about a running program's dependence on
its own file.  It's like erasing a source file and having the executable
disappear.  To me, if I do an "rm -rf /" as root, I expect to have
all the programs still running afterward (except perhaps those that
-should- exit when their configuration file disappears).
And having tar exit when it overwrites itself (and when it uses compress
as well, that multiplies the problem) is WRONG.  I happen to like using
tar to back up all my file systems, since I can read it under MS-DOG,
Amiga and other operating systems.  And it took me about 6 hours to restore
my file system once because of that little "feature".  Hour and a half
per restore, plus lotsa reboots from the fixit floppy.  Kept trying
to run a 2k tar program :-) I wonder why I kept getting core dumps?
While this is one of the most complex coding solutions, as it would require
flags for the VM code to set while executing the file (on the inode) and
the open() call would have to check it, I believe it is the -most- intuitive,
esp. for a person who never thinks of primary store "memory" as being tied
to secondary store "disk".  Let's remember VM is a nifty way to increase
our available memory, and not let it dictate how we deal with the abstractions
of it (more than it already has :-)

Just my $.02
-- 
Protect our endangered bandwidth - reply by email.  NO BIG SIGS!
VaX#n8 vax@ccwf.cc.utexas.edu - finger for more info if you even care.