Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Apr 2012 17:11:41 +0200
From:      Jeremie Le Hen <jeremie@le-hen.org>
To:        Pawel Jakub Dawidek <pjd@FreeBSD.org>
Cc:        Attilio Rao <attilio@freebsd.org>, Konstantin Belousov <kostikbel@gmail.com>, arch@freebsd.org
Subject:   Re: Prefaulting for i/o buffers
Message-ID:  <20120402151141.GA14531@felucia.tataz.chchile.org>
In-Reply-To: <20120225194630.GI1344@garage.freebsd.pl>
References:  <20120203193719.GB3283@deviant.kiev.zoral.com.ua> <CAJ-FndABi21GfcCRTZizCPc_Mnxm1EY271BiXcYt9SD_zXFpXw@mail.gmail.com> <20120225151334.GH1344@garage.freebsd.pl> <CAJ-FndBBKHrpB1MNJTXx8gkFXR2d-O6k5-HJeOAyv2DznpN-QQ@mail.gmail.com> <20120225194630.GI1344@garage.freebsd.pl>

next in thread | previous in thread | raw e-mail | index | archive | help
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/<name> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120402151141.GA14531>