From owner-freebsd-arch@FreeBSD.ORG Thu Sep 25 15:30:43 2014 Return-Path: Delivered-To: arch@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9A9CB4B8 for ; Thu, 25 Sep 2014 15:30:43 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 639CFD91 for ; Thu, 25 Sep 2014 15:30:43 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.9/8.14.9) with ESMTP id s8PFUhsf085013 for ; Thu, 25 Sep 2014 15:30:43 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.9/8.14.9/Submit) id s8PFUhYv085012 for arch@FreeBSD.org; Thu, 25 Sep 2014 15:30:43 GMT (envelope-from bdrewery) Received: (qmail 55550 invoked from network); 25 Sep 2014 10:30:38 -0500 Received: from unknown (HELO ?10.10.0.24?) (freebsd@shatow.net@10.10.0.24) by sweb.xzibition.com with ESMTPA; 25 Sep 2014 10:30:38 -0500 Message-ID: <54243510.7090009@FreeBSD.org> Date: Thu, 25 Sep 2014 10:30:24 -0500 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 MIME-Version: 1.0 To: Konstantin Belousov Subject: Re: KASSERT_WARN for asserting malloc(M_WAITOK) not in a non-sleepable thread References: <54236CD6.4050807@FreeBSD.org> <20140925074653.GP8870@kib.kiev.ua> In-Reply-To: <20140925074653.GP8870@kib.kiev.ua> OpenPGP: id=6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="PLqg260PPcR5Pj9vMN99dXkufH61t4nL2" Cc: arch@FreeBSD.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 15:30:43 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --PLqg260PPcR5Pj9vMN99dXkufH61t4nL2 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 9/25/2014 2:46 AM, Konstantin Belousov wrote: > On Wed, Sep 24, 2014 at 08:16:06PM -0500, Bryan Drewery wrote: >> By the way, it was mentioned to me that the interrupt assert may be >> wrong but from my understanding the thread is in an interrupt context = if >> td_intr_nesting_level>0, so the check seems fine to me. >=20 > It is wrong not due to the test for the interrupt level, but because > you must not call malloc(9) from the interrupt context at all, regardle= ss > of flags. At very least, it causes recursion on the malloc/uma locks, > but also it should damage the uma state. Ah. I understand now, the check for M_WAITOK is wrong, the KASSERT needs to move out of that. --=20 Regards, Bryan Drewery --PLqg260PPcR5Pj9vMN99dXkufH61t4nL2 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) iQEcBAEBAgAGBQJUJDUWAAoJEDXXcbtuRpfPJ0sH/3fWPG9KrydXujjQtVZLUIol coibag1N5CdrMkSb9qpWId3TrPcuzZiE448snxXnpuxSyorgjFje+52qRc4ukPva 4Pl9LVRt2WsXdf8pLP9Q4HmxdEN0ple+cw8zkN0e33qngcG0hJAgGdNQhkF0PV1H 6urdrR1xvJLf3ZMpL0WQd8RHh6y0vxI+RkyOSL+52mnKweygDxGfU0UeseSqJwzC mC0MZ9sAXSXKFvF2V5rTnPLeZU0RWvW6KPCu7f93yS1eyT8zJ3EpTqslVN7C8Twx xD/jV8N9vgirMejEyrUTKBgwin3pkdu6dNqa6pxmI8FfXc4ilEq88UgHHhp31q8= =oZA2 -----END PGP SIGNATURE----- --PLqg260PPcR5Pj9vMN99dXkufH61t4nL2--