Subject: Re: kern/30689 exit_lwps: lwp_wait1 failed with error 11
To: Rui Paulo <rpaulo@NetBSD.org>
From: Anil Gopinath <anil_public@yahoo.com>
List: tech-kern
Date: 08/09/2005 12:02:42
If we cannot safely recover from the deadlock I was
wondering if there was a way to ensure that the kernel
does not get to this state?

We are seing the problem described in bug 30689 and
the backtrace is pretty much the same as described in
the bug description. Any ideas as to what could be
leading up to this?

thanks,
Anil

--- Rui Paulo <rpaulo@NetBSD.org> wrote:

> On 2005.08.09 04:12:44 +0000, Rui Paulo wrote:
> | On 2005.08.08 20:03:29 +0000, Anil Gopinath wrote:
> | | 
> | | Is it possible to safely recover and not panic
> if
> | | lwp_wait1() returned error 11?
> | 
> | I don't think so, because:
> | 
> | int
> | lwp_wait1(struct lwp *l, lwpid_t lid, lwpid_t
> *departed, int flags)
> | {
> | 	...
> |         if (lid == l->l_lid)
> |                 return (EDEADLK); /* Waiting for
> ourselves makes no sense. */
> | 	...
> | }
> | 
> | EDEADLK is error number 11.
> 
> Also:
> 	...
>                 } else if (l2->l_stat == LSSLEEP ||
>                            l2->l_stat ==
> LSSUSPENDED) {
>                         /* Deadlock checks.
>                          * 1. If all other LWPs are
> waiting for exits
>                          *    or suspended, we would
> deadlock.
>                          */
> 
>                         LIST_FOREACH(l3, &p->p_lwps,
> l_sibling) {
>                                 if (l3 != l &&
> (l3->l_stat != LSSUSPENDED) &&
>                                     !(l3->l_stat ==
> LSSLEEP &&
>                                         l3->l_wchan
> == (caddr_t) &p->p_nlwps))
>                                         break;
>                         } 
>                         if (l3 == NULL) /* Everyone
> else is waiting. */
>                                 return (EDEADLK);
> 	...
> 
> 		-- Rui Paulo
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com