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
_______________________________________________
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to