Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Jan 2016 11:13:29 -0800
From:      Cy Schubert <cschuber@gmail.com>
To:        Alan Somers <asomers@freebsd.org>
Cc:        "src-committers@freebsd.org" <src-committers@freebsd.org>,  "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>,  "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>,  Cy Schubert <Cy.Schubert@komquats.com>
Subject:   RE: svn commit: r294329 - inhead/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys
Message-ID:  <569e8ad7.ce20620a.a05fc.ffffd4a5@mx.google.com>

next in thread | raw e-mail | index | archive | help
Thanks :)

I do a lot of ufs on zvols too, and yes, there are performance impacts due =
to double caching -- I use ufs and zfs mounted zvols for installworld/insta=
llkernel which are later unmounted on the host and booted as VMs for testin=
g.

Sent from my cellphone,
~Cy

-----Original Message-----
From: Alan Somers
Sent: 19/01/2016 10:55
Cc: src-committers@freebsd.org; svn-src-all@freebsd.org; svn-src-head@freeb=
sd.org
Subject: Re: svn commit: r294329 - inhead/sys/cddl/contrib/opensolaris/uts/=
common/fs/zfs: . sys

On Tue, Jan 19, 2016 at 10:00 AM, Alan Somers <asomers@freebsd.org> wrote:
> Author: asomers
> Date: Tue Jan 19 17:00:25 2016
> New Revision: 294329
> URL: https://svnweb.freebsd.org/changeset/base/294329
>
> Log:
>   Disallow zvol-backed ZFS pools
>
>   Using zvols as backing devices for ZFS pools is fraught with panics and
>   deadlocks. For example, attempting to online a missing device in the
>   presence of a zvol can cause a panic when vdev_geom tastes the zvol.  B=
etter
>   to completely disable vdev_geom from ever opening a zvol. The solution
>   relies on setting a thread-local variable during vdev_geom_open, and
>   returning EOPNOTSUPP during zvol_open if that thread-local variable is =
set.
>
>   Remove the check for MUTEX_HELD(&zfsdev_state_lock) in zvol_open. Its i=
ntent
>   was to prevent a recursive mutex acquisition panic. However, the new ch=
eck
>   for the thread-local variable also fixes that problem.
>
>   Also, fix a panic in vdev_geom_taste_orphan. For an unknown reason, thi=
s
>   function was set to panic. But it can occur that a device disappears du=
ring
>   tasting, and it causes no problems to ignore this departure.
>
>   Reviewed by:  delphij
>   MFC after:    1 week
>   Relnotes:     yes
>   Sponsored by: Spectra Logic Corp
>   Differential Revision:        https://reviews.freebsd.org/D4986
>
> Modified:
>   head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h
>   head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
>   head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
>   head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
>
> Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_im=
pl.h

Due to popular demand, I will conditionalize this behavior on a
sysctl, and I won't MFC it.  The sysctl must default to off (ZFS on
zvols not allowed) because having the ability to put pools on zvols
can cause panics even for users who aren't using it.  And let me clear
up some confusion:

1) Having the ability to put a zpool on a zvol can cause panics and
deadlocks, even if that ability is unused.
2) Putting a zpool atop a zvol causes unnecessary performance problems
because there are two layers of COW involved, with all their software
complexities.  This also applies to putting a zpool atop files on a
ZFS filesystem.
3) A VM guest putting a zpool on its virtual disk, where the VM host
backs that virtual disk with a zvol, will work fine.  That's the ideal
use case for zvols.
3b) Using ZFS on both host and guest isn't ideal for performance, as
described in item 2.  That's why I prefer to use UFS for VM guests.
4) Using UFS on a zvol as Stefen Esser described works fine.  I'm not
aware of any performance problems associated with mixing UFS and ZFS.
Perhaps Stefan was referring to duplication between the ARC and UFS's
vnode cache.  The same duplication would be present in a ZFS on top of
zvol scenario.

-Alan




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?569e8ad7.ce20620a.a05fc.ffffd4a5>