From owner-svn-src-head@freebsd.org Sun Nov 5 20:26:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6382E506DC; Sun, 5 Nov 2017 20:26:25 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-qt0-x230.google.com (mail-qt0-x230.google.com [IPv6:2607:f8b0:400d:c0d::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8C994699BF; Sun, 5 Nov 2017 20:26:25 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-qt0-x230.google.com with SMTP id z28so8688578qtz.13; Sun, 05 Nov 2017 12:26:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=WlgZAS9bw2bcdLVQFJewOzv5HoRQwZu28J2SWtrpgoE=; b=n/LyFm8FivUfojnu8D+drH3xu1R/Gg3CQgkomM1LuNqm8ttyp8rP0YUx7cOpeBEsoW Pr03r3oMjNjD5mQXTowu8s/vte6nUEO5NbfTcbq+HGZsg7PHy7yLmFDdecGhpKRh3A1j Jtsl/nDaKjaUKsWeefCoeUsKzFg60k5tgilBiTgL8hl2r48du2c0uZY9zvihuqzeDL8z V88v5ZK3Dp1R7QtFPsXEvn6p9Ui6cOgpIpSLv+XzF3f+r/yNNtyhxL05h4eEpkzM1N0N rFplLx9t9GGmKugMllfkzHCaCWlfNVX8Ohm5eazxzxqLgdtHtmIdxMOTjhbXsDhZKDWE b50g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=WlgZAS9bw2bcdLVQFJewOzv5HoRQwZu28J2SWtrpgoE=; b=g7csL05CeGqxoUGinJnwnwNw3xvd2aQRffs46bSm4tNfHELKyw7SANRiGRJAPcB1KB ryfcZPfi/PpAs7hV9OtHfupK1k1Iysl2Njolx8NA9BD/1OK07oGVsI43hD4Qu3Olk1sz 6rk8Trt97s6rhddt7lHFLHWxDIibaEPhzYBAduWmmBw06IHWO577wqhhqOHL33hCCKqe InFJgxZN/ynUBmogoYKSpAuLJQVB8zU4kv1vPq2Pj+9BmV0xuYQFhudV3oSv+l5Ot0jp RNf1+2aQdC/ks6YhVqtzKJTJQcNRKYLHVjAapazQX7hlhl8wAz3FlMP0c4T5aDQ0oKbY WkKQ== X-Gm-Message-State: AMCzsaWu6t3iPPOHOgNCOr2HmoKt3rS8sRoYgzozGH58KOJSrBMJpkww shNg7LX2ksW3MArIXVH2rDnlagu3i84DRcrQoDE= X-Google-Smtp-Source: ABhQp+Snale94xl1WHNiD+HhA7AV9ECuo+oMOpzxwU4Cz1nppMURhAYNlScBlxcGNQqexrIzpov/jV6rQh3zDDLHO+4= X-Received: by 10.200.57.55 with SMTP id s52mr20316982qtb.129.1509913584788; Sun, 05 Nov 2017 12:26:24 -0800 (PST) MIME-Version: 1.0 Received: by 10.237.52.198 with HTTP; Sun, 5 Nov 2017 12:26:24 -0800 (PST) In-Reply-To: <20171105201503.GH2566@kib.kiev.ua> References: <20171105130607.GA2566@kib.kiev.ua> <20171105173032.GE2566@kib.kiev.ua> <20171105190214.GG2566@kib.kiev.ua> <20f694b3-c60c-1b6d-76a1-2ef14cbdd698@FreeBSD.org> <1509910670.99235.70.camel@freebsd.org> <20171105201503.GH2566@kib.kiev.ua> From: Mateusz Guzik Date: Sun, 5 Nov 2017 21:26:24 +0100 Message-ID: Subject: Re: svn commit: r325386 - head/sys/kern To: Konstantin Belousov Cc: Ian Lepore , src-committers , "Conrad E. Meyer" , "svn-src-all@freebsd.org" , Andriy Gapon , "svn-src-head@freebsd.org" , Warner Losh Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 20:26:26 -0000 On Sun, Nov 5, 2017 at 9:15 PM, Konstantin Belousov wrote: > On Sun, Nov 05, 2017 at 12:37:50PM -0700, Ian Lepore wrote: > > IMO, the only reason ASSERT-style macros exist is to hide the > > conditional-on-build-type part of the operation. That is, to avoid > > having #ifdef INVARIANTS scattered everywhere. > bde' point is that KASSERT() is badly designed, and I agree with him. > Now we could at least remove the () around the message formatting part, > but it is too late. > > > > > Creating a macro to generate always-on error detection and reporting > > code just because there exists a macro to do so conditionally seems to > > turn the world on its head. > I agree with this statement. if()panic(); construct is good enough, IMO. > I don't like our panic messages whatsoever, they are quite often not informative. For instance consider: if (obj->foo < bar) panic("bad foo %d, have fun looking for bar"); Instead a macro akin to PASS(obj->foo, <, bar, "obj %p", obj); can expand itself to stringify the first 3 terms and also show the compared values. Saves on boiler-plate written by hand. I think *all* panics should be accompanied with a linux's oops-like dump. I'm not volunteering for any of it though. -- Mateusz Guzik