From owner-cvs-all Thu May 6 19:26:53 1999 Delivered-To: cvs-all@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 35FEA1529B; Thu, 6 May 1999 19:26:51 -0700 (PDT) (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id TAA12690; Thu, 6 May 1999 19:26:51 -0700 (PDT) (envelope-from mckusick@FreeBSD.org) Message-Id: <199905070226.TAA12690@freefall.freebsd.org> From: Kirk McKusick Date: Thu, 6 May 1999 19:26:51 -0700 (PDT) To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/contrib/sys/softupdates ffs_softdep.c Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk mckusick 1999/05/06 19:26:50 PDT Modified files: contrib/sys/softupdates ffs_softdep.c Log: Severe slowdowns have been reported when creating or removing many files at once on a filesystem running soft updates. The root of the problem is that soft updates limits the amount of memory that may be allocated to dependency structures so as to avoid hogging kernel memory. The original algorithm just waited for the disk I/O to catch up and reduce the number of dependencies. This new code takes a much more aggressive approach. Basically there are two resources that routinely hit the limit. Inode dependencies during periods with a high file creation rate and file and block removal dependencies during periods with a high file removal rate. I have attacked these problems from two fronts. When the inode dependency limits are reached, I pick a random inode dependency, UFS_UPDATE it together with all the other dirty inodes contained within its disk block and then write that disk block. This trick usually clears 5-50 inode dependencies in a single disk I/O. For block and file removal dependencies, I pick a random directory page that has at least one remove pending and VOP_FSYNC its directory. That releases all its removal dependencies to the work queue. To further hasten things along, I also immediately start the work queue process rather than waiting for its next one second scheduled run. Revision Changes Path 1.25 +290 -108 src/contrib/sys/softupdates/ffs_softdep.c To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message