From owner-svn-src-user@FreeBSD.ORG Wed May 18 20:43:46 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F2B41065670; Wed, 18 May 2011 20:43:46 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 4F4EE8FC1B; Wed, 18 May 2011 20:43:44 +0000 (UTC) Received: by wwc33 with SMTP id 33so2106920wwc.31 for ; Wed, 18 May 2011 13:43:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=fpZI/Y1l1nmex6CSZ28QioeZeD3DU0TB+8F8COVTOts=; b=xjEvGTujTosNktjqVkpFRtIMWFB9EWDQV0o0de8yCbUsIsSqwBdGv1lIAjphx3KhBz UQ/VPruuWigVJ26ERDQeWQ6hqUUL9VGJNvQjD00Lh/SC06dMptIM1nURKOFaVwfizPd1 rqpwODPutfPkMwkRB/hKJFkPzYghpT/6WZCjQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=DZ4B2nCWNRfkOs+Ei5qhT5VkvgPHEjZcOLxt6QgU1ejEgkR9ESTuYnZRYl7VoB/0Eq XlOWJq//5CGJ9pUZRREqHM0jZrqNqkjXkAY5SvttBSp+uqm+i6Sl10G3A3vijesoc+te XLVHQn3HNyOI0NufTMa8aCeSQKrhNu85Cv3kQ= MIME-Version: 1.0 Received: by 10.216.65.8 with SMTP id e8mr5063518wed.35.1305751423071; Wed, 18 May 2011 13:43:43 -0700 (PDT) Sender: mdf356@gmail.com Received: by 10.216.153.104 with HTTP; Wed, 18 May 2011 13:43:43 -0700 (PDT) In-Reply-To: References: <201105181508.p4IF8UoS096841@svn.freebsd.org> <20110518182441.GB2273@garage.freebsd.pl> <4DD4243C.4070301@FreeBSD.org> Date: Wed, 18 May 2011 13:43:43 -0700 X-Google-Sender-Auth: LxWv3dEWCdy2Y5sHwHkoESdEkok Message-ID: From: mdf@FreeBSD.org To: Attilio Rao Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: src-committers@freebsd.org, Pawel Jakub Dawidek , Andriy Gapon , svn-src-user@freebsd.org Subject: Re: svn commit: r222060 - in user/avg/xcpu/sys: kern sys X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 20:43:46 -0000 On Wed, May 18, 2011 at 1:06 PM, Attilio Rao wrote: > 2011/5/18 Andriy Gapon : >> on 18/05/2011 21:24 Pawel Jakub Dawidek said the following: >>> On Wed, May 18, 2011 at 03:08:30PM +0000, Andriy Gapon wrote: >>> [...] >>>> --- user/avg/xcpu/sys/sys/proc.h =A0 =A0 Wed May 18 15:07:36 2011 =A0 = =A0 =A0 =A0(r222059) >>>> +++ user/avg/xcpu/sys/sys/proc.h =A0 =A0 Wed May 18 15:08:30 2011 =A0 = =A0 =A0 =A0(r222060) >>>> @@ -781,7 +781,7 @@ MALLOC_DECLARE(M_SUBPROC); >>>> =A0 * Otherwise, the kernel will deadlock since the scheduler isn't >>>> =A0 * going to run the thread that holds the lock we need. >>>> =A0 */ >>>> -#define =A0 =A0 THREAD_PANICED() =A0 =A0 =A0 =A0\ >>>> +#define =A0 =A0 TD_IS_INPANIC() \ >>>> =A0 =A0 =A0(panicstr !=3D NULL && (curthread->td_flags & TDF_INPANIC) = !=3D 0) >>> >>> Does TDF_INPANIC make sense without panicstr being set? >> >> Very good observation. =A0It seems that TDF_INPANIC can never be set unl= ess >> panicstr is set. =A0So, I guess it should be OK to simplify the macro fu= rther. >> Thank you. > > However I think that TDF_INPANIC handling is not optimal. > You should really acquire thread_lock otherwise you are going to break > choosethread() concurrency. > > I would prefer to make TDF_INPANIC a private flag and just use it with > curthread, if possible, but I still don't have a good way to resolve > choosethread() (I would dig the runqueue adding path and resolve the > problem later in the codeflow, I think). I know it's almost required now (sync on reboot?!?!), but I would strongly question, from an architectural standpoint, why the scheduler should be running at all in panic. Once a thread pulls the panic trigger, nothing else should run except ddb in that thread's context. Cheers, matthew