From owner-freebsd-hackers@FreeBSD.ORG Fri May 6 20:19:43 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 228F2106566B; Fri, 6 May 2011 20:19:43 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id ED4FC8FC16; Fri, 6 May 2011 20:19:42 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id A457546B09; Fri, 6 May 2011 16:19:42 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id CCA268A02A; Fri, 6 May 2011 16:19:41 -0400 (EDT) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Fri, 6 May 2011 16:19:38 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110325; KDE/4.5.5; amd64; ; ) References: <4DC3BB5D.5080300@FreeBSD.org> In-Reply-To: <4DC3BB5D.5080300@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201105061619.38596.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Fri, 06 May 2011 16:19:42 -0400 (EDT) Cc: Andriy Gapon Subject: Re: thread_lock vs panic/trap X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2011 20:19:43 -0000 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