Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Jul 2013 14:28:14 +0300
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Andriy Gapon <avg@FreeBSD.org>
Cc:        freebsd-fs@FreeBSD.org, Adrian Chadd <adrian@FreeBSD.org>
Subject:   Re: Deadlock in nullfs/zfs somewhere
Message-ID:  <20130718112814.GA5991@kib.kiev.ua>
In-Reply-To: <51E7B686.4090509@FreeBSD.org>
References:  <CAJ-Vmomy3MrkSwJLQUGnDuD3EC3HzrudEghSDMeDwzVdaFNpLg@mail.gmail.com> <51DCFEDA.1090901@FreeBSD.org> <CAJ-VmokctCmV4%2By17uvqO9wXEyh0s%2BaXZ9nggvoAgP5%2BZHSgFA@mail.gmail.com> <51E59FD9.4020103@FreeBSD.org> <CAJ-VmokR8jJpdRc_kBJzhW4_R1pJnj3UPfsG5ANpq-kEGwCP9g@mail.gmail.com> <51E67F54.9080800@FreeBSD.org> <CAJ-Vmonk2HAzX38-mbL8hwxiUfL6JyJrMTq0dTBctW=P4dfyEQ@mail.gmail.com> <51E7B686.4090509@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--GFPlsJ7YtLjXgs8j
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Jul 18, 2013 at 12:33:58PM +0300, Andriy Gapon wrote:
> on 17/07/2013 20:19 Adrian Chadd said the following:
> > On 17 July 2013 04:26, Andriy Gapon <avg@freebsd.org> wrote:
> >> One possibility is to add getnewvnode_reserve() calls before the ZFS t=
ransaction
> >> beginnings in the places where a new vnode/znode may have to be alloca=
ted within
> >> a transaction.
> >> This looks like a quick and cheap solution but it makes the code somew=
hat messier.
> >>
> >> Another possibility is to change something in VFS machinery, so that V=
OP_RECLAIM
> >> getting blocked for one filesystem does not prevent vnode allocation f=
or other
> >> filesystems.
> >>
> >> I could think of other possible solutions via infrastructural changes =
in VFS or
> >> ZFS...
> >=20
> > Well, what do others think? This seems like a showstopper for systems
> > with lots and lots of ZFS filesystems doing lots and lots of activity.
> >=20
>=20
> Looks like others are not speaking yet :-)
>=20
> My current idea is that ZFS should set MNTK_SUSPEND in zfs_suspend_fs() p=
ath
> before acquiring its z_teardown* locks.  This should make intentions of Z=
FS
> visible to VFS.  And thus it should prevent VOP_RECLAIM call on a suspend=
ed ZFS
> filesystem and that should prevent vnlru_free() getting stuck.
> Hopefully this should break the deadlock cycle.
>=20
> Kostik,
>=20
> what is your opinion?
> For your convenience here is a message with my analysis of this issue:
> http://thread.gmane.org/gmane.os.freebsd.current/150889/focus=3D18534

Well, I have no opinion.  Making the fs suspended, in other words, preventi=
ng
writers from entering the filesystem code, is probably good.  I do not
know zfs code to usefully comment on the approach.

Note that you must drain existing writers, i.e. call vfs_write_suspend(),
to set MNTK_SUSPEND.

--GFPlsJ7YtLjXgs8j
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.20 (FreeBSD)

iQIcBAEBAgAGBQJR59FNAAoJEJDCuSvBvK1ByYMP/3njOyjvWN3fDjUVHiJmFgL+
9STNHDkzaHDTBd7TDtybGrqkljLoSrjkC9LVl6MyRwq2olJ1yhYQKmOlkaBeOaJt
rnuXvyGA2Wz4XTUIZVWaV/wtEPUMPskYv60ibYx00JuOFwA/oNR7J7fp/7bPirJ6
jPwQ+W9wU/Qzls3rMmhV2owqhSIUQD8egTB3Es/5Cda/+8zjR9yoQK0KLLCU4GbY
n8740XueGxZkTvM2C0ZstQ4JvRAbrRLKT7mCHadISov+ErPPwnnuWIYtYhB/gcq0
i9U5/JMNRyiTlyyDSEiePBtxf+iY9sxWYHi1hwWIWG28rLH3exEGn6kKzXB4q4Pe
NzRGJB4p8drGZb4NoUAikhqquY7Jmm8to5NMJzepV9AKa2a08WSHM4SMgk60oeUq
NO+XSpnazZK9Bu7shrYnlWdUjXAPzUzUlQArTRmI9cQjkEWiTzwpY2TFn6AFbvwM
HUu/AdDP4EBvrW/dyAeLmgocbErqZpNLlemLTBl6I3kfgB/Ytd3VcHbWZCMgP8cS
3DDbbaPqj6eFxXqObDgp+hAPhUaFvO8RW+FH3/SMj+zGjQ9+tmW9L47hB1jHbO8z
QIqXAQaAoqhATNurGVqj4qUtb3YX157Csw5+nRMTQ/IRmJghb5W5OxEALNyranmY
d4655Qai0ShZPuB/v8ZD
=aHUZ
-----END PGP SIGNATURE-----

--GFPlsJ7YtLjXgs8j--



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