From owner-svn-src-projects@FreeBSD.ORG  Mon Jul 30 15:31:51 2012
Return-Path: <owner-svn-src-projects@FreeBSD.ORG>
Delivered-To: svn-src-projects@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DA8E7106566C;
	Mon, 30 Jul 2012 15:31:51 +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 950E08FC1C;
	Mon, 30 Jul 2012 15:31:50 +0000 (UTC)
Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua
	[212.40.38.101])
	by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id SAA15425;
	Mon, 30 Jul 2012 18:31:49 +0300 (EEST)
	(envelope-from avg@FreeBSD.org)
Message-ID: <5016A8E4.7070405@FreeBSD.org>
Date: Mon, 30 Jul 2012 18:31:48 +0300
From: Andriy Gapon <avg@FreeBSD.org>
User-Agent: Mozilla/5.0 (X11; FreeBSD amd64;
	rv:13.0) Gecko/20120625 Thunderbird/13.0.1
MIME-Version: 1.0
To: attilio@FreeBSD.org
References: <201207301350.q6UDobCI099069@svn.freebsd.org>
	<CAJ-FndBJNNBNDUEDsDBUvwoVExZpnXmoJmpY58gE3QQbw3hRGA@mail.gmail.com>
	<CACYV=-HmOwZ=E8Pw3-mUw0994SbvZaA3eMfcwM0fDTu_zykBJg@mail.gmail.com>
	<CAJ-FndBmXkyJJ=fCkEpVm84E56A2_EoM6kbch03e4RMEM6WCGQ@mail.gmail.com>
	<20120730143943.GY2676@deviant.kiev.zoral.com.ua>
	<CAJ-FndByYcZ+UhnkFT_n2=W=UheqUCi0+UAX+F07EqbVU=6iDQ@mail.gmail.com>
	<CAJ-FndCQ6HGAfFdjofNfJ+HeNaE7uqoNhJB9GH4pGFxyZ_1yLg@mail.gmail.com>
	<5016A21B.6090409@FreeBSD.org>
	<CAJ-FndCFjZP=0ThpMxy6WSDQAZOm0TRkyu0bWfxVBwtT-h+1cA@mail.gmail.com>
In-Reply-To: <CAJ-FndCFjZP=0ThpMxy6WSDQAZOm0TRkyu0bWfxVBwtT-h+1cA@mail.gmail.com>
X-Enigmail-Version: 1.4.2
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Cc: Konstantin Belousov <kostikbel@gmail.com>,
	Davide Italiano <davide@FreeBSD.org>,
	svn-src-projects@FreeBSD.org, src-committers@FreeBSD.org
Subject: Re: svn commit: r238907 - projects/calloutng/sys/kern
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
	tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
	<mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
	<mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 30 Jul 2012 15:31:51 -0000

on 30/07/2012 18:04 Attilio Rao said the following:
> On 7/30/12, Andriy Gapon <avg@freebsd.org> wrote:
>> on 30/07/2012 17:56 Attilio Rao said the following:
>>> More explicitly, I think such combination TDP_NOSLEEPING +
>>> TDP_NOBLOCKING (name invented) should be set on entering the interrupt
>>> context, not only related to this part of callouts. This would be a
>>> very good help for catching buggy situations.
>>
>> Something very tangential.  I think it would also be nice to check if a
>> thread has
>> any(?) locks held when returning to userland.
> 
> This happens already for INVARIANTS case, with td_locks counters.
> In the !INVARIANTS case, this doesn't happen because you don't want to
> add the burden to bump td_locks for the fast case and I think it is a
> good approach.

Ah, I missed that, thank you.
BTW, it seems that td_locks is checked twice in normal syscallret() path: once in
syscallret() itself and then in userret().  On this note, would it make sense to
move the whole nine yards of asserts from syscallret() to userret()?
I mean it might make sense to have those checks (td_critnest, td_pflags) in other
paths to userland.

-- 
Andriy Gapon