*BSD News Article 62103


Return to BSD News archive

Newsgroups: comp.unix.bsd.freebsd.misc,comp.os.linux.development.system
Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.bhp.com.au!mel.dit.csiro.au!munnari.OZ.AU!news.ecn.uoknor.edu!paladin.american.edu!gatech!newsfeed.internetmci.com!EU.net!sun4nl!cs.vu.nl!kjb
From: kjb@cs.vu.nl (Kees J Bot)
Subject: Re: The better (more suitable)Unix?? FreeBSD or Linux
Nntp-Posting-Host: hornet.cs.vu.nl
References: <4ggc9k$kbv@park.uvsc.edu> <4ggj2f$mej@park.uvsc.edu> <4ggo5v$mon@park.uvsc.edu> <4gic4k$6rt@park.uvsc.edu> <4giku8$7k8@park.uvsc.edu> <4giqhh$a9d@park.uvsc.edu>
Sender: news@cs.vu.nl
Organization: Fac. Wiskunde & Informatica, VU, Amsterdam
Date: Fri, 23 Feb 1996 13:48:09 GMT
Message-ID: <Dn8ECA.468.0.-s@cs.vu.nl>
Lines: 32
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.freebsd.misc:14302 comp.os.linux.development.system:17936

Terry Lambert <terry@lambert.org> writes:

[snip]

>After some offline prompting, I checked the code path for an
>unlink, and it looks like FreeBSD doesn't do the change time
>update on the directory inode synchronously.

>I think this is probably in violation of POSIX semantic
>requirements (else why make the distinction in the standard
>between "shall be updated" and "shall be marked for update"?).
>Nevertheless, the extra overhead I described is apparently
>limited to the SVR4 UFS implementation.

Under Minix "shall be marked for update" is done by setting a bit in the
in-core inode telling that one of [amc]time must be updated somewhere in
the future.  "Shall be updated" is done by actually writing the current
time into one of [amc]time that has been marked for update.

Why?  Because getting the current time is an expensive call from the file
server to the clock task.  The last close of a file, one of the stat()
calls or a sync() triggers the time update.  He who wrote this code
assumed that this is what POSIX meant by "shall be marked for update",
i.e. getting the time may be expensive, so you can delay it until "shall
be updated".

Old-fashioned monolithic operating systems can keep the current time in
a global variable, so they need not bother to first mark for and later
update a time field, but can update it immediately.
--
	                        Kees J. Bot  (kjb@cs.vu.nl)
	              Systems Programmer, Vrije Universiteit Amsterdam