From owner-svn-src-user@FreeBSD.ORG Wed May 18 20:06:20 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 2A991106564A; Wed, 18 May 2011 20:06:20 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 8E4EA8FC0C; Wed, 18 May 2011 20:06:19 +0000 (UTC) Received: by vws18 with SMTP id 18so1914059vws.13 for ; Wed, 18 May 2011 13:06:18 -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=9UhxP7kwoZCV+h/+B6vw9SdW6urPCac3b+MOhh7AVv0=; b=DKlA1Z+uPwFKonzsCS3TkUd8gaUePbSy5xpjCVIUSQavxXxSBBii7583mrEJ3bd9v7 EOZFSLoz+VyTEJxmnQDlppfca0Goc4jdUUk2X15t9dukqJpKED36o4VzC8wo/fCocWmA 5LgRhbZnhi22TISsYqmM52hrvbmLRXxl7BMeA= 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=Ld/vT9fBEK41LxBOv2qsykGLXdQOdjBqdLdXNUFC+FHU5FgbS7+qM+CMLGNjs9Nl3P pFkvdx/mek4686E2gE9N0i3BJmqHLFVwJ1w0x4glhC0aMOjbl1hFYPgIBw/3KiMARCHx ffsvGAP4ZUUdh0VEXSAdR769rFKqZIoBpKnHU= MIME-Version: 1.0 Received: by 10.220.190.67 with SMTP id dh3mr681298vcb.97.1305749178517; Wed, 18 May 2011 13:06:18 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.220.201.3 with HTTP; Wed, 18 May 2011 13:06:18 -0700 (PDT) In-Reply-To: <4DD4243C.4070301@FreeBSD.org> References: <201105181508.p4IF8UoS096841@svn.freebsd.org> <20110518182441.GB2273@garage.freebsd.pl> <4DD4243C.4070301@FreeBSD.org> Date: Wed, 18 May 2011 16:06:18 -0400 X-Google-Sender-Auth: on4g37tcIVtxS93Elv01SmgxGNE Message-ID: From: Attilio Rao To: Andriy Gapon Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: src-committers@freebsd.org, Pawel Jakub Dawidek , 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:06:20 -0000 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 =C2=A0 =C2=A0 Wed May 18 15:07:36 2011= =C2=A0 =C2=A0 =C2=A0 =C2=A0(r222059) >>> +++ user/avg/xcpu/sys/sys/proc.h =C2=A0 =C2=A0 Wed May 18 15:08:30 2011= =C2=A0 =C2=A0 =C2=A0 =C2=A0(r222060) >>> @@ -781,7 +781,7 @@ MALLOC_DECLARE(M_SUBPROC); >>> =C2=A0 * Otherwise, the kernel will deadlock since the scheduler isn't >>> =C2=A0 * going to run the thread that holds the lock we need. >>> =C2=A0 */ >>> -#define =C2=A0 =C2=A0 THREAD_PANICED() =C2=A0 =C2=A0 =C2=A0 =C2=A0\ >>> +#define =C2=A0 =C2=A0 TD_IS_INPANIC() \ >>> =C2=A0 =C2=A0 =C2=A0(panicstr !=3D NULL && (curthread->td_flags & TDF_I= NPANIC) !=3D 0) >> >> Does TDF_INPANIC make sense without panicstr being set? > > Very good observation. =C2=A0It seems that TDF_INPANIC can never be set u= nless > panicstr is set. =C2=A0So, I guess it should be OK to simplify the macro = further. > 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). Attilio --=20 Peace can only be achieved by understanding - A. Einstein