From owner-freebsd-fs@FreeBSD.ORG Sat Nov 20 20:48:58 2004 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1917716A4CE for ; Sat, 20 Nov 2004 20:48:58 +0000 (GMT) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id A0D9843D49 for ; Sat, 20 Nov 2004 20:48:57 +0000 (GMT) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (localhost [127.0.0.1]) by fledge.watson.org (8.13.1/8.13.1) with ESMTP id iAKKlJGA023343 for ; Sat, 20 Nov 2004 15:47:19 -0500 (EST) (envelope-from robert@fledge.watson.org) Received: from localhost (robert@localhost)iAKKlJ5m023340 for ; Sat, 20 Nov 2004 20:47:19 GMT (envelope-from robert@fledge.watson.org) X-Received: from cyrus.watson.org ([unix socket]) by cyrus.watson.org (Cyrus v2.1.16) with LMTP; Sat, 20 Nov 2004 08:28:59 -0500 X-Sieve: CMU Sieve 2.2 X-Received: from mx2.freebsd.org (mx2.freebsd.org [216.136.204.119]) by cyrus.watson.org (Postfix) with ESMTP id 98BF746B09 for ; Sat, 20 Nov 2004 08:28:59 -0500 (EST) X-Received: from hub.freebsd.org (hub.freebsd.org [216.136.204.18]) by mx2.freebsd.org (Postfix) with ESMTP id 3F13B559A9; Sat, 20 Nov 2004 13:28:53 +0000 (GMT) (envelope-from owner-freebsd-current@freebsd.org) X-Received: from hub.freebsd.org (localhost [127.0.0.1]) by hub.freebsd.org (Postfix) with ESMTP id AEF9616A4D2; Sat, 20 Nov 2004 13:28:50 +0000 (GMT) Delivered-To: freebsd-current@freebsd.org X-Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6B15316A4CE for ; Sat, 20 Nov 2004 05:24:12 +0000 (GMT) X-Received: from mail.chesapeake.net (chesapeake.net [208.142.252.6]) by mx1.FreeBSD.org (Postfix) with ESMTP id D5D7743D46 for ; Sat, 20 Nov 2004 05:24:11 +0000 (GMT) (envelope-from jroberson@chesapeake.net) X-Received: from mail.chesapeake.net (localhost [127.0.0.1]) by mail.chesapeake.net (8.12.10/8.12.10) with ESMTP id iAK5OBPV058643 for ; Sat, 20 Nov 2004 00:24:11 -0500 (EST) (envelope-from jroberson@chesapeake.net) X-Received: from localhost (jroberson@localhost)iAK5OB89058639 for ; Sat, 20 Nov 2004 00:24:11 -0500 (EST) (envelope-from jroberson@chesapeake.net) X-Authentication-Warning: mail.chesapeake.net: jroberson owned process doing -bs Date: Sat, 20 Nov 2004 00:24:10 -0500 (EST) From: Jeff Roberson To: current@FreeBSD.org Message-ID: <20041120000743.G18094@mail.chesapeake.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Mailman-Approved-At: Sat, 20 Nov 2004 13:28:46 +0000 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Sender: owner-freebsd-current@FreeBSD.org Errors-To: owner-freebsd-current@FreeBSD.org ReSent-Date: Sat, 20 Nov 2004 20:47:14 +0000 (GMT) Resent-From: robert Resent-To: fs@FreeBSD.org ReSent-Message-ID: Subject: Giantless VFS. X-BeenThere: freebsd-fs@freebsd.org List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Nov 2004 20:48:58 -0000 I have a patch that I would like people to test and review. It's available here: http://www.chesapeake.net/~jroberson/smpffs.diff The short description: This patch removes Giant from the read(), write(), and fstat() syscalls, as well as page faults, and bufdone (io interrupts) when using FFS. It adds a considerable amount of locking to FFS and softupdates. You may also use non ffs filesystems concurrently, but they will be protected by Giant. If you are using quotas you should not yet run this patch. I have done some buildworlds, but any heavy filesystem activity would be appreciated. Long description: There is now a per mount-point mutex in struct ufsmount that covers ffs's struct fs related allocation routines. The rest of the filesystem was already covered by the buffer locks on cgs, indirs, etc, as well as a few mutexes that were already in place. I made great attempts to minimize the number of lock operations for the common cases which resulted in a couple of functions which may be entered with the UFS lock held, but return without it held. Where this is not already done, it will be documented in comments. The softupdate lk lock has been turned into a mutex, and it now protects all global worklists, inode and page dep hash buckets, etc. interlocked_sleep() is gone now that BUF_LOCK() and msleep() take interlock arguments. getdirtybuf() has been slightly changed to solve some sleep related races that I disucssed with Kirk. For now there is a single softupdates mutex, but eventually it will be made per-mountpoint and potentially merged with the ufsmount lock. On the infrastructure side, the buffer cache was locked some time ago, and now the vm is safe to run without Giant, so there are simply a lot of removed GIANT_REQUIRED lines. I added some locking to vn_start_write() and friends, and made some changes for LORs there. There is a pair of new macros called VFS_(UN)LOCK_GIANT(mp) which inspects a new flag on the mount-point to determine if we have to acquire giant. This is done very early in the syscall path before we call any VOPs. The mountpoints should be safe to inspect as we always own a reference to the vnode in the cases that I have unwound for now. Cheers, Jeff _______________________________________________ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"