From owner-freebsd-fs@FreeBSD.ORG Mon Nov 8 14:32:35 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 E40BF106566B; Mon, 8 Nov 2010 14:32:35 +0000 (UTC) (envelope-from gleb.kurtsou@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 4423B8FC19; Mon, 8 Nov 2010 14:32:34 +0000 (UTC) Received: by bwz3 with SMTP id 3so4924375bwz.13 for ; Mon, 08 Nov 2010 06:32:34 -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=7VW5+8jQ+fRzpA3ohr1dYewahGI6mBkL1elER2pkx0c=; b=eCzFYxwhNTr6AaFtTgYTwRSF33lWCsyabha8NyJaJzz07FWCFshXMhgK/WLHLwefFW iCrNAjTpJHGDQrTeWbANn3KiTtd6xkUFdfkzHOYSbf8hqo/nQX7nSphkT9Fu8NmWwEnm nJHNeHOUg88HNZVxrbBmLYdj+1/99lXIfvrt4= 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=F/Xcusv9TFJ3BJHYORP5j8QDMI8dWIwJYlWh5l3PDGKcPuOzoE9tVkbfQly/gOQtE/ 82Rqnn1SsXzp2kypTFqYQw5vzd7OPw2prag7xjfqNM9gVV2F6k17WkUMq0G2Zb3RwwSK x3bL5a5fx8+FqJFzW9bqDGu/1NGDAtSvuZ1jc= Received: by 10.204.62.193 with SMTP id y1mr4957723bkh.131.1289226695087; Mon, 08 Nov 2010 06:31:35 -0800 (PST) Received: from localhost ([91.187.5.20]) by mx.google.com with ESMTPS id r21sm3911608bkj.22.2010.11.08.06.31.33 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 08 Nov 2010 06:31:33 -0800 (PST) Date: Mon, 8 Nov 2010 16:31:30 +0200 From: Gleb Kurtsou To: Ivan Voras Message-ID: <20101108143130.GA2799@tops> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-fs@freebsd.org 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 14:32:36 -0000 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. > > _______________________________________________ > 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"