From owner-freebsd-arch@FreeBSD.ORG Sat Sep 27 14:53:29 2014 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9D0A5AF4; Sat, 27 Sep 2014 14:53:29 +0000 (UTC) Received: from mail-la0-x233.google.com (mail-la0-x233.google.com [IPv6:2a00:1450:4010:c03::233]) (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 BB9BF84D; Sat, 27 Sep 2014 14:53:28 +0000 (UTC) Received: by mail-la0-f51.google.com with SMTP id pv20so6419357lab.10 for ; Sat, 27 Sep 2014 07:53:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=dqDKvi7EHYu8ONxVoxVT9vAprii8gHkmbpb2Ueuok5Q=; b=U4q0d1EcDACBqGwmxM8uSESsT5CWAAwQSnn7pQT8YZlbpvf18qwIKDxewv4FQQEUWF CGDE/145pSwM1fdA9zNuk0xnE8iRLhVnFxxNO3xCeEEcsJDtQEwzXhAkeGKCnAsenagJ LVnJkwxwBwrNHx6Sr3WqJcLrUQXq2WjkxuzcwsBmQyXWPYfdtdo1oN5xIAD2hzLMLgm2 Sctl4Rh0qPqiLHUvmXL0sbnx+WzVgMXop9rHhRNxyQ00aR4NqzxhLvVxHA5Ux/Hjdf+t sGVvUcRhlC3m1i8e1i6Pif46bYq9kpFb5fmHOJIieu9+y8mZCUZykdeUAF1dBe2RxkhL ZwvQ== MIME-Version: 1.0 X-Received: by 10.112.201.42 with SMTP id jx10mr2761716lbc.101.1411829606664; Sat, 27 Sep 2014 07:53:26 -0700 (PDT) Sender: chmeeedalf@gmail.com Received: by 10.25.15.29 with HTTP; Sat, 27 Sep 2014 07:53:26 -0700 (PDT) Received: by 10.25.15.29 with HTTP; Sat, 27 Sep 2014 07:53:26 -0700 (PDT) In-Reply-To: <54267CAE.4090009@FreeBSD.org> References: <54236CD6.4050807@FreeBSD.org> <5424392D.9030201@FreeBSD.org> <1411668571.66615.247.camel@revolution.hippie.lan> <5425CAB6.2010102@FreeBSD.org> <54267CAE.4090009@FreeBSD.org> Date: Sat, 27 Sep 2014 07:53:26 -0700 X-Google-Sender-Auth: BGQxI6NUqm6BeU-_czUBM7c--Ec Message-ID: Subject: Re: KASSERT_WARN for asserting malloc(M_WAITOK) not in a non-sleepable thread From: Justin Hibbits To: Andriy Gapon Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: Bryan Drewery , 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: Sat, 27 Sep 2014 14:53:29 -0000 On Sep 27, 2014 2:01 AM, "Andriy Gapon" wrote: > > On 26/09/2014 23:21, Bryan Drewery wrote: > > On 9/25/2014 1:22 PM, Justin Hibbits wrote: > >> I like my bikeshed a nice royal blue. At a previous job we used > >> ASSERT and VERIFY macros. VERIFY was comparable to this (warn if > >> condition not met, don't panic), so how about KVERIFY() (I'll also > >> support KWARN, but I think KVERIFY() conveys a better message by > >> name). > > > > I will commit it as KVERIFY tonight based on the majority consensus. > > Even at work right now we are tracking down an odd bug where this could > > be useful to have temporarily. > > > > Not sure if the following bit of information will influence your decision, but > anyway. In the Solaris source code ASSERT is used like our KASSERT where DEBUG > macro controls its definition like our INVARIANTS do. But VERIFY is used like > KASSERT that is never compiled out. So, my personal preference would be to use > KWARN for something that only warns. > That sounds like pretty good precedent. I fully support it or Davide's DEBUG_WARN suggestion, and agree it makes more sense than KVERIFY from this context. -Justin