*BSD News Article 62838


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!news.syd.connect.com.au!gidora.kralizec.net.au!not-for-mail
From: bde@zeta.org.au (Bruce Evans)
Newsgroups: comp.unix.bsd.freebsd.misc,comp.os.linux.development.system
Subject: Re: The better (more suitable)Unix?? FreeBSD or Linux
Date: 24 Feb 1996 23:38:41 +1100
Organization: Kralizec Dialup Unix
Lines: 60
Message-ID: <4gn0sh$2g3@godzilla.zeta.org.au>
References: <4ggc9k$kbv@park.uvsc.edu> <4ggo5v$mon@park.uvsc.edu> <4gic4k$6rt@park.uvsc.edu> <4giku8$7k8@park.uvsc.edu>
NNTP-Posting-Host: godzilla.zeta.org.au
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.freebsd.misc:14906 comp.os.linux.development.system:18700

In article <4giku8$7k8@park.uvsc.edu>,
Terry Lambert  <terry@lambert.org> wrote:
>mday@park.uvsc.edu (Matt Day) wrote:
>
>[ ... rm and POSIX semantics adding to the overhead ... ]
>[ ... ]
>] What you have said here is completely wrong!
>[ ... ]
>
>BSD also does a sync update of the directory change time in the
>directory inode.  It was this "metadata", not the directory
>entry itself, to which I was referring when I said this was an
>unnecessary overhead.

Wrong, at least for unlink() in FreeBSD.  Only one synchronous write (in
ufs_dirremove() for the directory entry) is done for unlinking an empty
file.  Two are done for unlinking a short nonempty file (one more in
ffs_truncate() for truncating the file).  The file's inode is written
asynchronously at the end of ffs_update().

In FreeBSD, timestamp updates are only committed immediately for utimes().
This is fixed in my version.

>I know that you and I disagree on whether the POSIX semantic
>"shall be updated" means "shall be committed to disk" or not.
>I know that "shall be marked for update" means that it is
>permissible to use a delayed write (modify the value in memory
>and mark the structure dirty).  I disagree about the "shall
>be updated" requiring only a commit to memory rather than to
>permanent storage.

"Shall be updated" means that the time shall be recorded in the file's
metadata metadata before the system call returns.  "Marked for update"
means that the time shall be recorded before certain future system calls
return.  FreeBSD always updates the time immediately since reading the
time is efficient.

POSIX doesn't specify permanent storage.  Disks may be good enough
for you, but others may prefer stone tablets.

>From my perspective, then, POSIX adds unnecessary overhead for
>preserving what seem to be VMS or other historical semantics
>for no other apparent reason, other than history.  8-(.

The requirement to keep access timestamps is onerous.  Access times
could be handled specially to avoid the overhead of scattered inode
updates.  E.g., cache them in contiguous blocks in memory and on
disk don't bother updating them when updating the inodes.

>] To summarize: every time you delete a file on FreeBSD, two separate
>] synchronous metadata updates occur: one for the directory entry and one
>] for the inode.  The reason the updates are synchronous is to prevent
>] irreparable metadata inconsistencies from occurring.  It has absolutely
>] nothing to do with POSIX semantics.
>
>Three.  See above.

One or two.  See above.
-- 
Bruce Evans  bde@zeta.org.au