From owner-freebsd-current@FreeBSD.ORG Thu Nov 17 08:34:32 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 CF9C5106566B; Thu, 17 Nov 2011 08:34:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id EA50C8FC14; Thu, 17 Nov 2011 08:34:31 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id KAA09615; Thu, 17 Nov 2011 10:34:29 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1RQxQS-000BfN-Jw; Thu, 17 Nov 2011 10:34:28 +0200 Message-ID: <4EC4C712.8040701@FreeBSD.org> Date: Thu, 17 Nov 2011 10:34:26 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:8.0) Gecko/20111108 Thunderbird/8.0 MIME-Version: 1.0 To: Kostik Belousov References: <20111113083215.GV50300@deviant.kiev.zoral.com.ua> <20111116202714.5ee4bd53@fabiankeil.de> <4EC43764.1020202@FreeBSD.org> <4EC4423A.3020904@FreeBSD.org> <20111117081533.GP50300@deviant.kiev.zoral.com.ua> In-Reply-To: <20111117081533.GP50300@deviant.kiev.zoral.com.ua> X-Enigmail-Version: undefined Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Alexander Motin , 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, 17 Nov 2011 08:34:32 -0000 on 17/11/2011 10:15 Kostik Belousov said the following: > On Thu, Nov 17, 2011 at 01:07:38AM +0200, Alexander Motin wrote: >> On 17.11.2011 00:21, Andriy Gapon wrote: >>> Going further up the stack one can come up with the following proposals: >>> - check SCHEDULER_STOPPED() swi_sched() and return early >>> - do not call swi_sched() from xpt_done() if we somehow know that we are >>> in a >>> polling mode >> >> There is no flag in CAM now to indicate polling mode, but if needed, it >> should not be difficult to add one and not call swi_sched(). > > I have the following change for eons on my test boxes. Without it, > I simply cannot get _any_ dump. > > diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c > index 10b89c7..a38e42f 100644 > --- a/sys/cam/cam_xpt.c > +++ b/sys/cam/cam_xpt.c > @@ -4230,7 +4230,7 @@ xpt_done(union ccb *done_ccb) > TAILQ_INSERT_TAIL(&cam_simq, sim, links); > mtx_unlock(&cam_simq_lock); > sim->flags |= CAM_SIM_ON_DONEQ; > - if (first) > + if (first && panicstr == NULL) > swi_sched(cambio_ih, 0); > } > } I think that this (or similar) change should go into the patch and the tree. -- Andriy Gapon