Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Nov 2006 12:12:46 +0200
From:      Kostik Belousov <kostikbel@gmail.com>
To:        Steven Hartland <killing@multiplay.co.uk>
Cc:        freebsd-fs@freebsd.org, Mike Jakubik <mikej@rogers.com>, freebsd-stable@freebsd.org
Subject:   Re: md deadlocks on wdrain. Was: [Re: quota and snapshots in6.1-RELEASE]
Message-ID:  <20061123101246.GM1841@deviant.kiev.zoral.com.ua>
In-Reply-To: <027b01c70e6c$6c879470$b3db87d4@multiplay.co.uk>
References:  <447366AD.30203@rogers.com> <20060701034922.GA37822@deviant.kiev.zoral.com.ua> <027b01c70e6c$6c879470$b3db87d4@multiplay.co.uk>

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

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

On Wed, Nov 22, 2006 at 07:28:37PM -0000, Steven Hartland wrote:
> The patch below fixed this issue for us. We had a jail which
> when upgrading ( installworld ) from 5.4 to 6.1 would constantly
> hang the machine with this error.
>=20
> After updating md.c to 1.164 from MAIN and applying the patch
> below I've managed to run installworld 3 times now without error.
> Previously including updated to v1.164 this would hang without
> fail.
>=20
> If this is the correct fix, it would be good to see get committed
> as it have the capability to knock out any box running a vnode
> backed jail and is very unpredictable.
This is not a fix, this is only a way to make the deadlock less frequent
(I would not ever call it workaround). I have got a reports of deadlocks
with this change applied, and I think that I understand the cause of it.
Also, I have an idea of how to fix it, but not got around to even start
coding.

> ? sys/dev/md/.arch-ids
> Index: sys/dev/md/md.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> RCS file: /usr/local/arch/ncvs/src/sys/dev/md/md.c,v
> retrieving revision 1.164
> diff -u -r1.164 md.c
> --- sys/dev/md/md.c 28 Mar 2006 21:25:11 -0000 1.164
> +++ sys/dev/md/md.c 1 Jul 2006 03:48:41 -0000
> @@ -650,6 +650,8 @@
>  mtx_lock_spin(&sched_lock);
>  sched_prio(curthread, PRIBIO);
>  mtx_unlock_spin(&sched_lock);
> + if (sc->type =3D=3D MD_VNODE)
> +  curthread->td_pflags |=3D TDP_NORUNNINGBUF;
>=20
>  for (;;) {
>   mtx_lock(&sc->queue_mtx);

--LQv0vi9oZBoYbpa7
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (FreeBSD)

iD8DBQFFZXQdC3+MBN1Mb4gRAumDAJ9rK2AMG6wsyddAUqFGhjpeGah6FgCg9qUr
+LWdv4tFahID2t7vBR6vD8I=
=gFhp
-----END PGP SIGNATURE-----

--LQv0vi9oZBoYbpa7--



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