From owner-freebsd-current@FreeBSD.ORG Thu Dec 8 15:40:19 2011 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6E17106564A; Thu, 8 Dec 2011 15:40:19 +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 B9FCB8FC15; Thu, 8 Dec 2011 15:40:19 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 7106046B0D; Thu, 8 Dec 2011 10:40:19 -0500 (EST) Received: from John-Baldwins-MacBook-Air.local (c-68-36-150-83.hsd1.nj.comcast.net [68.36.150.83]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id E6348B93A; Thu, 8 Dec 2011 10:40:18 -0500 (EST) Message-ID: <4EE0DA63.8000305@FreeBSD.org> Date: Thu, 08 Dec 2011 10:40:19 -0500 From: John Baldwin User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: Andriy Gapon References: <20111113083215.GV50300@deviant.kiev.zoral.com.ua> <201112011349.50502.jhb@freebsd.org> <4ED7E6B0.30400@FreeBSD.org> <201112011553.34432.jhb@freebsd.org> <4ED7F4BC.3080206@FreeBSD.org> <4ED855E6.20207@FreeBSD.org> <4ED8A306.9020801@FreeBSD.org> <4EDBF01B.8000802@FreeBSD.org> In-Reply-To: <4EDBF01B.8000802@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 08 Dec 2011 10:40:19 -0500 (EST) Cc: mdf@FreeBSD.org, freebsd-current@FreeBSD.org Subject: Re: Stop scheduler on panic X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Dec 2011 15:40:20 -0000 On 12/4/11 5:11 PM, Andriy Gapon wrote: > on 02/12/2011 17:30 mdf@FreeBSD.org said the following: >> On Fri, Dec 2, 2011 at 2:05 AM, Andriy Gapon wrote: >>> on 02/12/2011 06:36 John Baldwin said the following: >>>> Ah, ok (I had thought SCHEDULER_STOPPED was going to always be true when kdb was >>>> active). But I think these two changes should cover critical_exit() ok. >>>> >>> >>> I attempted to start a discussion about this a few times already :-) >>> Should we treat kdb context the same as SCHEDULER_STOPPED context (in the >>> current definition) ? That is, skip all locks in the same fashion? >>> There are pros and contras. >> >> Does kdb pause all CPUs with an interrupt (NMI or regular interrupt, I >> can no longer remember...) when it enters? If so, then I'd say >> whether it enters via sysctl or panic doesn't matter. It's in a >> special environment where nothing else is running, which is what is >> needed for proper exploration of the machine (via breakpoint, for >> debugging a hang, etc). >> >> Maybe the question is, why wouldn't SCHEDULER_STOPPED be true >> regardless of how kdb is entered? > > I think that the discussion that followed has clarified this point a bit. > SCHEDULER_STOPPED perhaps needs a better name :-) Currently it, the name, > reflects the state of the scheduler, but not why the scheduler is stopped and > not the greater state of the system ("in panic"), nor how we should handle that > state ("bypass locking"). So I'd love something like BYPASS_LOCKING_BECAUSE > _SCHEDULER_IS_STOPPED_IN_PANIC haven't it be so unwieldy :) Oh, hmm. Yes, being in the debugger should not potentially corrupt lock state, so in that sense it is a weaker stop. -- John Baldwin