Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1a 12/4/83; site rlgvax.UUCP Path: utzoo!watmath!clyde!burl!ulysses!harpo!seismo!rlgvax!guy From: guy@rlgvax.UUCP (Guy Harris) Newsgroups: net.arch Subject: Re: Why not virtual files? Message-ID: <1893@rlgvax.UUCP> Date: Wed, 2-May-84 01:33:49 EDT Article-I.D.: rlgvax.1893 Posted: Wed May 2 01:33:49 1984 Date-Received: Thu, 3-May-84 19:48:08 EDT References: <6845@umcp-cs.UUCP> Organization: CCI Office Systems Group, Reston, VA Lines: 37 > Traditional, disk based, filesystems have several important > advantages over memory-mapped filesystems in the event > of a crash. > Since traditional filesystems force the process to wait for > the actual disk access, they are kept more up to date (on disk) > than a memory-mapped filesystem would be (unless you force > a disk write after each file write, in which case you lose > some of the performance of a memory-mapped filesystem). > More importantly, your process must have a way to know > when data it has written is safely non-volitile. > A file that is in memory is an easy victim to the runaway > rabid cpu, and will have to be backed up to its disk > saved previous state if it is to be salvaged reasonably. > A disk controller is far safer from accidental file munging, > and disk files usually weather cpu crashes. Well, since the UNIX file system has a cache in the kernel, this problem occurs with UNIX's non-memory-mapped file system. What is needed is a way to force a given "disk block", whether it's in your process' virtual memory or in the kernel buffer cache, to be flushed to disk on command (and for the process to be blocked until it is). 4.2BSD has the "fsync" system call, and at least the VAX-11 version of System V has an undocumented file descriptor flag (settable by "fcntl") which forces all writes to that file descriptor to be synchronous (it's undocumented because it's a possibly-unintentional side-effect of the way they implemented synchronous writes of file system data structures). I suspect these issues have been discussed, both for memory-mapped and non-memory-mapped filesystems, by the same people who came up with notions like "stable storage" when implementing crash-resistant file and database systems. Guy Harris {seismo,ihnp4,allegra}!rlgvax!guy