md deadlocks on wdrain. Was: [Re: quota and snapshots in6.1-RELEASE]

Kostik Belousov kostikbel at gmail.com
Thu Nov 23 02:13:03 PST 2006


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.
> 
> 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.
> 
> 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
> ===================================================================
> 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 == MD_VNODE)
> +  curthread->td_pflags |= TDP_NORUNNINGBUF;
> 
>  for (;;) {
>   mtx_lock(&sc->queue_mtx);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20061123/16b57df2/attachment.pgp


More information about the freebsd-stable mailing list