From owner-freebsd-current Wed Oct 14 18:57:31 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id SAA09999 for freebsd-current-outgoing; Wed, 14 Oct 1998 18:57:31 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from smtp02.primenet.com (smtp02.primenet.com [206.165.6.132]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id SAA09970 for ; Wed, 14 Oct 1998 18:57:26 -0700 (PDT) (envelope-from tlambert@usr04.primenet.com) Received: (from daemon@localhost) by smtp02.primenet.com (8.8.8/8.8.8) id SAA16458; Wed, 14 Oct 1998 18:57:04 -0700 (MST) Received: from usr04.primenet.com(206.165.6.204) via SMTP by smtp02.primenet.com, id smtpd016436; Wed Oct 14 18:56:57 1998 Received: (from tlambert@localhost) by usr04.primenet.com (8.8.5/8.8.5) id SAA17973; Wed, 14 Oct 1998 18:56:55 -0700 (MST) From: Terry Lambert Message-Id: <199810150156.SAA17973@usr04.primenet.com> Subject: Re: SoftUpdates anomaly: what happens when you 'mount -u -o ro /usr'? To: dag-erli@ifi.uio.no (Dag-Erling C. =?iso-8859-1?Q?Sm=F8rgrav?=) Date: Thu, 15 Oct 1998 01:56:54 +0000 (GMT) Cc: current@FreeBSD.ORG In-Reply-To: from "Dag-Erling C. =?iso-8859-1?Q?Sm=F8rgrav?=" at Oct 14, 98 05:06:45 pm X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG What happens is that dependent data on the FS itself gets written out, but depedent data on the device vnode that the FS is mounted on does not. Basically, this is a systemic problem which has not been addressed, and it's the primary reason soft updates is a tunefs parameter instead of a mount option. I basically think that this is the wrong implementation, and I have argued with both Kirk and Julian about it on occasion (my personal take is that the act of a mount update should in fact unmount and then remount the device, syncing all buffers on the unmount). If you explicitly unmount the partition, then re-mount it, I believe it should work (obviously, you will have to try this with a partition other than /usr). The place to hide this is in the kernel in the common mount code, and then to instance the mounts seperately from their mappings into the FS hierarchy, so that the FS specific mount code can get a hell of a lot more simple. This turns a -o into a call to the FS specific unmount, then the FS specific mount, while leaving the objects allocated on the FS intact (it becomes the job of the common mount code to do the object destruction). The only wierd thing this implies is that, if the FS is managing it's own vnode pool, that there be seperate entry points for initialization and destruction of the pool, other than the ones that would have been implied by the mount/unmount. This is only an issue for things like CODA and TFS, so it's not a worry that has to be dealt with immediately. > I woke up to find my nightly doc build had failed due to a full /usr > partition. It's a 256MB partition with 160MB of data on it, so there > had to be a catch somewhere. I ran 'fsck -n' which revealed 13,500 > unreferenced files. Sounds like the soft clock had not had an opportunity to drain. You should have done a vmstat to see how many soft updates buffers were in use, and if the number was decreasing, or if there was a real problem (for a mounted FS with uncommitted softclock contents, what you saw is pretty much expected behaviour). > Now looking through the fsck output (I scripted it) it seems that the > unreferenced files were mostly binaries, and I bet if I looked closer > I'd find out the mtimes are consistent with days I've run make world. > What's more, I'm not missing any files; my bet is that the > unreferenced files are files which have been deleted (replaced) by > installworld. They're unreferenced because they were unlinked, but for > some reason they were never freed. I think somebody with more fs > experience than I have should take a look at what happens to a > softupdates fs when it is switched from rw to ro. It seems obvious to > me that pending writes should be flushed; it also appears that this > doesn't actually happen. This may be a real dependency issue, actually, or it may just be that the programs were used in the buildworld, and were still cached, so the cache was holding a reference on them, and they would eventually go away. I would be kind of surprised if there were a real dependency issue, unless the recent vfs_subr.c changes were at fault. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message