Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 May 2011 16:19:38 -0400
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-hackers@freebsd.org
Cc:        Andriy Gapon <avg@freebsd.org>
Subject:   Re: thread_lock vs panic/trap
Message-ID:  <201105061619.38596.jhb@freebsd.org>
In-Reply-To: <4DC3BB5D.5080300@FreeBSD.org>
References:  <4DC3BB5D.5080300@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Friday, May 06, 2011 5:11:57 am Andriy Gapon wrote:
> 
> Can a current thread panic or receive a trap while some other thread holds its
> thread_lock (the same lock as pointed to by the td_lock)?

I'm sure it's theoretically possible.  If the thread is running just about
anywhere and another thread is changing its cpuset for example, then you could
run into this.

> And a related question, can there be a reason for a thread in panic or kdb
> context to try to get the thread_lock?

I think it isn't safe to try to grab one's own thread lock in panic or kdb
for this reason.

-- 
John Baldwin



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