From owner-freebsd-current@FreeBSD.ORG Fri Mar 11 11:33:54 2005 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1D2EB16A4CE; Fri, 11 Mar 2005 11:33:54 +0000 (GMT) Received: from darkness.comp.waw.pl (darkness.comp.waw.pl [195.117.238.136]) by mx1.FreeBSD.org (Postfix) with ESMTP id B3AE943D2D; Fri, 11 Mar 2005 11:33:53 +0000 (GMT) (envelope-from pjd@darkness.comp.waw.pl) Received: by darkness.comp.waw.pl (Postfix, from userid 1009) id 93059ACBCB; Fri, 11 Mar 2005 12:33:51 +0100 (CET) Date: Fri, 11 Mar 2005 12:33:51 +0100 From: Pawel Jakub Dawidek To: freebsd-current@freebsd.org Message-ID: <20050311113351.GC9291@darkness.comp.waw.pl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="E+r5CZjTUHNgkElv" Content-Disposition: inline User-Agent: Mutt/1.4.2i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 5.2.1-RC2 i386 Subject: crypto_q_mtx recursion. X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 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: Fri, 11 Mar 2005 11:33:54 -0000 --E+r5CZjTUHNgkElv Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi. I had a panic related to mutex recursion, the code path is as follows: crypto_dispatch() CRYPTO_Q_LOCK() crypto_invoke() crypto_done() cryptodev_cb() (via crp->crp_callback) crypto_dispatch() CRYPTO_Q_LOCK() <- recursion. Not sure how to fix it. Calling 'locked' version of crypto_dispatch() is not an option, as we can call cryptodev_cb() with or without crypto_q_mtx held. The only fix I can came up with right not is a "pseudo-recursion" in crypto_dispatch(): int unlock =3D 0; [...] if (!mtx_owned(&crypto_q_mtx)) { unlock =3D 1; CRYPTO_Q_LOCK(); } [...] if (unlock) CRYPTO_Q_LOCK(); --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --E+r5CZjTUHNgkElv Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFCMYIfForvXbEpPzQRAsCtAJ9aaGcM8dzT/jnHGxAmrNyPhx98vACdGC99 7o/U8Lch2UJZ5ZWOe03U7qw= =Iakb -----END PGP SIGNATURE----- --E+r5CZjTUHNgkElv--