From owner-freebsd-arch@FreeBSD.ORG Thu Sep 25 17:12:15 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 EA3B5460; Thu, 25 Sep 2014 17:12:14 +0000 (UTC) Received: from mail-pa0-x22f.google.com (mail-pa0-x22f.google.com [IPv6:2607:f8b0:400e:c03::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B0C27C9; Thu, 25 Sep 2014 17:12:14 +0000 (UTC) Received: by mail-pa0-f47.google.com with SMTP id rd3so659757pab.34 for ; Thu, 25 Sep 2014 10:12:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=jMnAu3VXgEAbhUbqOZFpSSWoylmkGeHBrd/hvopOcP0=; b=nWFBkwq0Qx9Atjx9XDZPi7ZsgZ5Asls5WBz6bKjIXaN9hsT6fzsiKS2cA3BzJFC3Qa 42X2nYk3u2sfHaFDjcCcjx8oST8nppTqrnvJeMxrOzltKVS47eUgpK5aVtfYKvZvae0b B/tii36YVIRHmTJqbT31WwW3eqCdXxWekR1p6uz0UyteCYA7QEBpIsgfdhlmyTcmZPsy XRpGOmlsClyRfMjyaiE3KaYz0hTJNUlybL7WNdxbZsr8yvQBbTaV6f3nmqDfxKBbwLTv 16Y8We3cuCjgjRtL2ysdIQ5jT7GdtrCTiE44vkDBnJZetqfeAtpq5XnsfxMdmMX867+h E/Cw== X-Received: by 10.66.240.197 with SMTP id wc5mr21126412pac.87.1411665134325; Thu, 25 Sep 2014 10:12:14 -0700 (PDT) Received: from [10.192.166.0] (stargate.chelsio.com. [67.207.112.58]) by mx.google.com with ESMTPSA id ra7sm2736797pab.22.2014.09.25.10.12.12 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Sep 2014 10:12:13 -0700 (PDT) Sender: Navdeep Parhar Message-ID: <54244CEB.2010204@FreeBSD.org> Date: Thu, 25 Sep 2014 10:12:11 -0700 From: Navdeep Parhar User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.1.0 MIME-Version: 1.0 To: Adrian Chadd , Bryan Drewery Subject: Re: KASSERT_WARN for asserting malloc(M_WAITOK) not in a non-sleepable thread References: <54236CD6.4050807@FreeBSD.org> <5424392D.9030201@FreeBSD.org> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: "freebsd-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 17:12:15 -0000 On 09/25/14 09:14, Adrian Chadd wrote: > Hi, > > Please bring in KASSERT_WARN(). > > I'm grown up enough to use KASSERT_WARN() along with handling the > invariant check myself in code. Having KASSERT_WARN() means I can add > in this rather than printf()s or device_printf()'s with various knobs > to remove it. > > (This is absolutely _not_ the "should KASSERT() optionally just log" > argument. I'm not going to get into that a second time.) Yeah, let's avoid a repeat. You could call it KWARN (no form of "assert" anywhere in its name) to sidestep any discussion on whether invariants and assertions are ironclad or not. It's easier/shorter to type in as well. Regards, Navdeep > > > -a > > > On 25 September 2014 08:47, Bryan Drewery wrote: >> On 9/24/2014 9:56 PM, Davide Italiano wrote: >>> On Wed, Sep 24, 2014 at 6:16 PM, Bryan Drewery wrote: >>>> Hi, >>>> >>>> I've placed 2 reviews out in relation to >>>> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=193696: >>>> >>>> Add KASSERT_WARN which will work just like KASSERT except that no panic >>>> 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 >>>> >>> >>> 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. >>> >>> -- >>> 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. >> >> -- >> Regards, >> Bryan Drewery >> > _______________________________________________ > freebsd-arch@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-arch > To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org" >