Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Dec 2006 12:56:47 +0300
From:      Dmitriy Kirhlarov <dimma@higis.ru>
To:        John Baldwin <jhb@freebsd.org>
Cc:        Gleb Smirnoff <glebius@freebsd.org>, freebsd-stable@freebsd.org
Subject:   Re: RELENG_6 panic under heavy load
Message-ID:  <20061208095646.GA1131@dkirhlarov.mow.oilspace.com>
In-Reply-To: <200612061209.40253.jhb@freebsd.org>
References:  <20061113084430.GE59604@dimma.mow.oilspace.com> <20061116111525.GO32700@FreeBSD.org> <20061116160900.GQ32700@FreeBSD.org> <200612061209.40253.jhb@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Dec 06, 2006 at 12:09:39PM -0500, John Baldwin wrote:

> > ...) and here is something difficult to understand, when $poll tries to
> > make $fork runnable, while $fork is trying to put itself in the turnstile
> > that is owned by $poll
> 
> Hmm.  I'm guessing the problem is the $poll thread is suspended (not exited) 
> while holding the proc lock?  That would appear to be the problem.  That 
> thread can't run again to release the lock.  Ah, yes, I see the bug.  
> Something like this should fix it:
> 
> Index: kern_thread.c
> ===================================================================
> RCS file: /usr/cvs/src/sys/kern/kern_thread.c,v
> retrieving revision 1.216.2.6
> diff -u -r1.216.2.6 kern_thread.c
> --- kern_thread.c       2 Sep 2006 17:29:57 -0000       1.216.2.6
> +++ kern_thread.c       6 Dec 2006 17:06:26 -0000
> @@ -969,7 +969,9 @@
>         TAILQ_REMOVE(&p->p_suspended, td, td_runq);
>         TD_CLR_SUSPENDED(td);
>         p->p_suspcount--;
> +       critical_enter();
>         setrunnable(td);
> +       critical_exit();
>  }
> 
>  /*
> 
> What this does is force setrunnable() to be in a nested critical section so we 
> won't preempt during setrunnable() until either the caller of 
> thread_unsuspend_one() eventually releases sched_lock, or, in the case you 
> ran into, the thread does a PROC_UNLOCK() and calls mi_switch().

lbsd02# uptime
9:46AM  up 22:45, 2 users, load averages: 7.50, 6.59, 6.32

It's work. Thank, you.
Without your patch max uptime was 9 hours.

I'm planning to test David's patch on weekend.

WBR
Dmitriy



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