From owner-svn-src-projects@FreeBSD.ORG Mon Jul 30 14:43:35 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8135B106566C; Mon, 30 Jul 2012 14:43:35 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id EE4318FC16; Mon, 30 Jul 2012 14:43:34 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q6UEdunN036602; Mon, 30 Jul 2012 17:39:56 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q6UEdhlW080457; Mon, 30 Jul 2012 17:39:43 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q6UEdhkA080456; Mon, 30 Jul 2012 17:39:43 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 30 Jul 2012 17:39:43 +0300 From: Konstantin Belousov To: Attilio Rao Message-ID: <20120730143943.GY2676@deviant.kiev.zoral.com.ua> References: <201207301350.q6UDobCI099069@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="zNkIgqbxA+tiK/WQ" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean Cc: Davide Italiano , 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 " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jul 2012 14:43:35 -0000 --zNkIgqbxA+tiK/WQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jul 30, 2012 at 03:24:26PM +0100, Attilio Rao wrote: > On 7/30/12, Davide Italiano wrote: > > On Mon, Jul 30, 2012 at 4:02 PM, Attilio Rao wrot= e: > > Thanks for the comment, Attilio. > > Yes, it's exactly what you thought. If direct flag is equal to one > > you're sure you're processing a callout which runs directly from > > hardware interrupt context. In this case, the running thread cannot > > sleep and it's likely you have TDP_NOSLEEPING flags set, failing the > > KASSERT() in THREAD_NO_SLEEPING() and leading to panic if kernel is > > compiled with INVARIANTS. > > In case you're running from SWI context (direct equals to zero) code > > remains the same as before. > > I think what I'm doing works due the assumption thread running never > > sleeps. Do you suggest some other way to handle this? >=20 > Possibly the quicker way to do this is to have a way to deal with the > TDP_NOSLEEPING flag in recursed way, thus implement the same logic as > VFS_LOCK_GIANT() does, for example. > You will need to change the few callers of THREAD_NO_SLEEPING(), but > the patch should be no longer than 10/15 lines. There are already curthread_pflags_set/restore KPI designed exactly to hand= le nested private thread flags. Also, I wonder, should you assert somehow that direct dispatch cannot block as well ? --zNkIgqbxA+tiK/WQ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAlAWnK8ACgkQC3+MBN1Mb4j5WwCg6LbznxGnAdFUAWhKH4tuWs5/ e7YAnj9sBgT6t3r7sfRJ09cMmmu0Rlq3 =YxNw -----END PGP SIGNATURE----- --zNkIgqbxA+tiK/WQ--