From owner-freebsd-arch@FreeBSD.ORG Thu Sep 25 15:48:07 2014 Return-Path: Delivered-To: freebsd-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 C9BFEC81 for ; Thu, 25 Sep 2014 15:48:07 +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 A9F22F89 for ; Thu, 25 Sep 2014 15:48:07 +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 s8PFm7u2091496 for ; Thu, 25 Sep 2014 15:48:07 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.9/8.14.9/Submit) id s8PFm7P4091495 for freebsd-arch@freebsd.org; Thu, 25 Sep 2014 15:48:07 GMT (envelope-from bdrewery) Received: (qmail 92384 invoked from network); 25 Sep 2014 10:48:06 -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:48:06 -0500 Message-ID: <5424392D.9030201@FreeBSD.org> Date: Thu, 25 Sep 2014 10:47:57 -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: freebsd-arch@freebsd.org Subject: Re: KASSERT_WARN for asserting malloc(M_WAITOK) not in a non-sleepable thread References: <54236CD6.4050807@FreeBSD.org> In-Reply-To: OpenPGP: id=6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jiHQEwHe0AgVBGmR73xkDD8jHW6UADXQr" 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:48:08 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --jiHQEwHe0AgVBGmR73xkDD8jHW6UADXQr Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 9/24/2014 9:56 PM, Davide Italiano wrote: > On Wed, Sep 24, 2014 at 6:16 PM, Bryan Drewery w= rote: >> Hi, >> >> I've placed 2 reviews out in relation to >> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D193696: >> >> Add KASSERT_WARN which will work just like KASSERT except that no pani= c >> will occur. My own expectation would be that any use of it would >> eventually be promoted to a full KASSERT. It would only be used where= >> the impact is not known yet on all hardware/devices. We don't want to= >> go adding a KASSERT and break boot for a whole class of systems. >> >> https://reviews.freebsd.org/D829 - KASSERT_WARN >> >=20 > FYI, I'm not excited about the idea. If you introduce an assert you > want some invariant to not be violated. If it's violated, there's > something clearly going wrong and you need to stop and think about it. > I guess that in most cases is just better fail early, rather than keep > going with the system in a semi-functional state. Also, please note > that once a KPI is introduced in the kernel, everybody may start > abusing it. > A previous attempt (in my opinion wrong) was made to have KASSERT to > log rather than panic. It actually didn't lead to any benefit, > apparently. FWIW, at least your approach is more fine grained. >=20 > -- > Davide I would be comfortable adding it in as a full KASSERT (and not bringing in KASSERT_WARN) if other people test the patch in https://reviews.freebsd.org/D830 and change them to KASSERT. If the fallout is not too bad then we can commit the real assert. --=20 Regards, Bryan Drewery --jiHQEwHe0AgVBGmR73xkDD8jHW6UADXQr 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) iQEcBAEBAgAGBQJUJDktAAoJEDXXcbtuRpfPjRwH/3IoiP7zk2EjJIVvHwoP403z zZkRZmGOvu9Fd2uMH3+Nx042RI1TXLMtoKvrorPo94nLmYRyusj15VMqwY+SWKGc AgQlULUC5Q9UWRaOS4W1zp4OtM4URYO2nvN3pY3IYDbGhc620nnN72GUDFUKsYKr w8WX9jxK4r1vEKksNG919DjBOjS821XxOSmgfQlBS3W4lmMVIfRCCZTfLUeUJWIA 1DJFOxLzy9bFqzLqOoLE1MLrwigung4gKdGXzd37ioFK63DR5assZHTJ05Znx0cw EySgX2vRkHiIy4G5R/+FBn2C7rwr3lAf4sDGSzt1TjN9okwEIhkpyelOHju9DgU= =Xy6B -----END PGP SIGNATURE----- --jiHQEwHe0AgVBGmR73xkDD8jHW6UADXQr--