From owner-cvs-all Tue Nov 14 1:13:51 2000 Delivered-To: cvs-all@freebsd.org Received: from elvis.mu.org (elvis.mu.org [207.154.226.10]) by hub.freebsd.org (Postfix) with ESMTP id 0089B37B479; Tue, 14 Nov 2000 01:13:47 -0800 (PST) Received: by elvis.mu.org (Postfix, from userid 1000) id 826372B21B; Tue, 14 Nov 2000 03:13:41 -0600 (CST) Date: Tue, 14 Nov 2000 01:13:41 -0800 From: Paul Saab To: Kirk McKusick Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/ufs/ffs ffs_softdep.c Message-ID: <20001114011341.A87240@elvis.mu.org> References: <200011140900.BAA91171@freefall.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200011140900.BAA91171@freefall.freebsd.org>; from mckusick@FreeBSD.org on Tue, Nov 14, 2000 at 01:00:25AM -0800 Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I spent quite a bit of time with Kirk on this one to hopefully fix the problem with running without fscking the filesystems after a crash on softupdates enabled filesystems. After pulling the power while doing massive amounts of writes/deletes I was unable to trigger a panic on non-clean filesystems. I am also running some machines in production at Yahoo with this code and so far they have not had any problems running with filesystems that were not fsck'd at boot. Kirk McKusick (mckusick@FreeBSD.org) wrote: > mckusick 2000/11/14 01:00:25 PST > > Modified files: > sys/ufs/ffs ffs_softdep.c > Log: > When deleting a file, the ordering of events imposed by soft updates > is to first write the deleted directory entry to disk, second write > the zero'ed inode to disk, and finally to release the freed blocks > and the inode back to the cylinder-group map. As this ordering > requires two disk writes to occur which are normally spaced about > 30 seconds apart (except when memory is under duress), it takes > about a minute from the time that a file is deleted until its inode > and data blocks show up in the cylinder-group map for reallocation. > If a file has had only a brief lifetime (less than 30 seconds from > creation to deletion), neither its inode nor its directory entry > may have been written to disk. If its directory entry has not been > written to disk, then we need not wait for that directory block to > be written as the on-disk directory block does not reference the > inode. Similarly, if the allocated inode has never been written to > disk, we do not have to wait for it to be written back either as > its on-disk representation is still zero'ed out. Thus, in the case > of a short lived file, we can simply release the blocks and inode > to the cylinder-group map immediately. As the inode and its blocks > are released immediately, they are immediately available for other > uses. If they are not released for a minute, then other inodes and > blocks must be allocated for short lived files, cluttering up the > vnode and buffer caches. The previous code was a bit too aggressive > in trying to release the blocks and inode back to the cylinder-group > map resulting in their being made available when in fact the inode > on disk had not yet been zero'ed. This patch takes a more conservative > approach to doing the release which avoids doing the release prematurely. > > Revision Changes Path > 1.75 +19 -16 src/sys/ufs/ffs/ffs_softdep.c > > -- Paul Saab Technical Yahoo paul@mu.org - ps@yahoo-inc.com - ps@freebsd.org Do You .. uhh .. Yahoo!? To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message