From owner-freebsd-arch@FreeBSD.ORG Mon Apr 2 15:11:53 2012 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64EEE106564A; Mon, 2 Apr 2012 15:11:53 +0000 (UTC) (envelope-from jeremie@le-hen.org) Received: from smtp5-g21.free.fr (smtp5-g21.free.fr [IPv6:2a01:e0c:1:1599::14]) by mx1.freebsd.org (Postfix) with ESMTP id 62E738FC15; Mon, 2 Apr 2012 15:11:49 +0000 (UTC) Received: from endor.tataz.chchile.org (unknown [82.233.239.98]) by smtp5-g21.free.fr (Postfix) with ESMTP id 62139D480EC; Mon, 2 Apr 2012 17:11:43 +0200 (CEST) Received: from felucia.tataz.chchile.org (felucia.tataz.chchile.org [192.168.1.9]) by endor.tataz.chchile.org (Postfix) with ESMTP id 2AE622414; Mon, 2 Apr 2012 15:11:42 +0000 (UTC) Received: by felucia.tataz.chchile.org (Postfix, from userid 1000) id ED50A9978; Mon, 2 Apr 2012 15:11:41 +0000 (UTC) Date: Mon, 2 Apr 2012 17:11:41 +0200 From: Jeremie Le Hen To: Pawel Jakub Dawidek Message-ID: <20120402151141.GA14531@felucia.tataz.chchile.org> Mail-Followup-To: Pawel Jakub Dawidek , Attilio Rao , Konstantin Belousov , arch@freebsd.org References: <20120203193719.GB3283@deviant.kiev.zoral.com.ua> <20120225151334.GH1344@garage.freebsd.pl> <20120225194630.GI1344@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120225194630.GI1344@garage.freebsd.pl> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Attilio Rao , Konstantin Belousov , arch@freebsd.org Subject: Re: Prefaulting for i/o buffers X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Apr 2012 15:11:53 -0000 Hi, On Sat, Feb 25, 2012 at 08:46:31PM +0100, Pawel Jakub Dawidek wrote: > > I did not implement rangelocking for ZFS. It came with ZFS when I ported > it. Until we want to merge changes from upstream (which is now IllumOS) > we don't want to make huge changes just for the sake of proving that > this is general purpose mechanism used by more than one file system. > > Attilio, don't get me wrong. In 99% cases it is good to make code more > general and more universal and reusable, but we can't ignore reality. > > There are reasons why file systems like XFS, ReiserFS and others where > never fully ported. I'm not saying VFS complexity was the only reason, > but I'm sure it was one of them. > > Our VFS is very UFS-centric. We make so many assumptions that sounds > fine only for UFS. I saw plenty of those while working on ZFS, like: > > - "Every file system needs cache. Let's make it general, so that all file > systems can use it!" Well, for VFS each file system is a separate > entity, which is not the case for ZFS. ZFS can cache one block only > once that is used by one file system, 10 clones and 100 snapshots, > which all are separate mount points from VFS perspective. > The same block would be cached 111 times by the buffer cache. > > - "rmdir(2) on a mountpoint is bad idea, let's deny it at VFS level." > It is bad idea, indeed, but in ZFS it is a nice way to remove snapshot > by rmdiring .zfs/snapshot/ directory. > > - Noone implemented rangelocking in VFS, so no file system can use it. > Even if the given file system has all the code to do it. > > etc. > > I'm also sure it will be way easier for Jeff to make VFS MP-safe if it > was less complex. > > When looking at the big picture, it would be nice to have all this > general stuff like rangelocking, quota, buffer cache, etc. as some kind > of libraries for file systems to use and not something that is > mandatory. If I develop a file system for FreeBSD only and I don't want > to reinvent the wheel, I can use those libraries. If I port file system > to FreeBSD or develop a file system that doesn't really need those > libraries I'm not forced to use them. I'm a little late on this thread, but I had to mention that there was a very interesting article on LWN a few years ago about the "midlayer mistake" design pattern, which really reminds me the subject here. http://lwn.net/Articles/336262/ Regards, -- Jeremie Le Hen Men are born free and equal. Later on, they're on their own. Jean Yanne