From owner-freebsd-fs@FreeBSD.ORG Mon Nov 8 17:42:06 2010 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C80361065670; Mon, 8 Nov 2010 17:42:06 +0000 (UTC) (envelope-from sarawgi.aditya@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 6706D8FC1C; Mon, 8 Nov 2010 17:42:06 +0000 (UTC) Received: by vws20 with SMTP id 20so304346vws.13 for ; Mon, 08 Nov 2010 09:42:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=mVm82mMOju9/lRR1t+H4KvygCcVHzO9IC7P0G4Xoec0=; b=mZl+1r8gul7aUFomCPoCIrBmGirOVQbTSCNUwtQDVYK9xVDch6YhyXCOtODUoNuHfq AD23+OICwH28W+zu14ms8/EFuP7+suDQ8dpxSj6hzMXWA4ArXHfHUaS2Jo0okfvjKh8E dBJ19bsxCKYu8NwTOhc0x3ef8GKf0WU6ayuYc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=QikkURkohMdyJYDueRVpcaH+sCbxKmtABQgy8zSaRRUyMWRuscE7O7gRGQ5bQbxMOy vOvpHJGOJJdObvAOfDkt3ZTwdrVr03fTtu6OKsS719Wcv65cX+Hj9zMHNKuGR0RqwJML oiyc/KkDKkPzMyi6kkwwG3OTpF//7QA9Nm5ZA= Received: by 10.224.199.6 with SMTP id eq6mr4503915qab.272.1289236803254; Mon, 08 Nov 2010 09:20:03 -0800 (PST) Received: from earth ([183.87.49.109]) by mx.google.com with ESMTPS id y21sm79987yhc.14.2010.11.08.09.20.00 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 08 Nov 2010 09:20:02 -0800 (PST) Date: Mon, 8 Nov 2010 22:51:39 +0530 From: Aditya Sarawgi To: Gleb Kurtsou Message-ID: <20101108172136.GA2066@earth> References: <20101108143130.GA2799@tops> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101108143130.GA2799@tops> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-fs@freebsd.org, Ivan Voras Subject: Re: The state of Giant lock in the file systems? X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 17:42:07 -0000 On Mon, Nov 08, 2010 at 04:31:30PM +0200, Gleb Kurtsou wrote: > On (08/11/2010 13:28), Ivan Voras wrote: > > I was looking at fusefs sources and there is a dance it does with the > > Giant lock which looks fishy. > It's intended to be fishy. No kernel level locks should be held before > returning to userland, in other words on each syscall vnode is locked (+ > Gaint lock for fs if needed), than it's unlocked by filesystem and > relocked upon callback from userspace. puffs is MPSAFE if that could be > of any help for you. > > > Grepping for "-ir giant" in /sys/fs on 8-stable shows only a handful of > > mentionings, but if I understand it correctly only these "active" instances: > > > > 1) one set of mtx_assert() calls on it in pseudofs, which I can't figure > > out what they're guarding > > 2) some manual locking and unlocking in nfsclient which appears to only > > guard printf() (???) > Somewhat unrelated, but. Does NFS client unlock vnodes while > sending/waiting for RCP reply? I thought it does, but I'm not sure. > > > 3) some more locking in nfsserver which apparently is only there to > > guard the underlying local file system > > 4) coda, which appears to be the only one marked with D_NEEDGIANT, but > > doesn't do much of its own interfacing with it > > > > Except for these, is there any more magic that would need to be resolved > > to excise Giant from VFS? > Kostik was working on it. > > > Would it be correct to think that coda is the single biggest obstacle? > Filesystem should be marked as MPSAFE, it's not D_NEEDGIANT flag but > MNTK_MPSAFE. A lot of filesystems are still locked by Gaint, i.e ext2fs, > smbfs, nwfs, ntfs, etc. > ext2fs on 9-CURRENT is MPSAFE. > > > > _______________________________________________ > > freebsd-fs@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-fs > > To unsubscribe, send any mail to "freebsd-fs-unsubscribe@freebsd.org" > _______________________________________________ > freebsd-fs@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-fs > To unsubscribe, send any mail to "freebsd-fs-unsubscribe@freebsd.org"