From owner-freebsd-arch@FreeBSD.ORG Tue Jul 30 02:39:14 2013 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 ESMTP id B3E819E3; Tue, 30 Jul 2013 02:39:14 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from aslan.scsiguy.com (aslan.scsiguy.com [70.89.174.89]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6E48C2DA3; Tue, 30 Jul 2013 02:39:14 +0000 (UTC) Received: from [192.168.0.99] (macbook.scsiguy.com [192.168.0.99]) (authenticated bits=0) by aslan.scsiguy.com (8.14.7/8.14.5) with ESMTP id r6U2dCOi034033 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Tue, 30 Jul 2013 02:39:12 GMT (envelope-from gibbs@FreeBSD.org) Subject: Re: translate INVARIANTS to DEBUG for code from OpenSolaris Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Content-Type: text/plain; charset=us-ascii From: "Justin T. Gibbs" X-Priority: 3 In-Reply-To: <69CEF0CC3C8C4B9BBA8E3ACACB18DC2B@multiplay.co.uk> Date: Mon, 29 Jul 2013 20:39:12 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <751C9B66-0476-4E3B-AF07-FAFF2F54FEBB@FreeBSD.org> References: <51F67B2A.3040302@FreeBSD.org> <69CEF0CC3C8C4B9BBA8E3ACACB18DC2B@multiplay.co.uk> To: Steven Hartland X-Mailer: Apple Mail (2.1508) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (aslan.scsiguy.com [70.89.174.89]); Tue, 30 Jul 2013 02:39:12 +0000 (UTC) Cc: Andriy Gapon , freebsd-arch@FreeBSD.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Jul 2013 02:39:14 -0000 On Jul 29, 2013, at 12:25 PM, Steven Hartland = wrote: > ----- Original Message ----- From: "Andriy Gapon" >=20 >> [zfs-devel@, fs@, dtrace@ are Bcc-ed] >> In OpenSolaris and its descendants DEBUG is used in a fashion similar = to our >> INVARIANTS. For example, ASSERT macros are enabled by it. >> In our kernel code DEBUG has a different meaning and enables far too = verbose or >> far too obscure code and, as such, it is very rarely enabled. >> The idea of a change that I would like to propose is to translate = INVARIANTS >> kernel option into DEBUG for the files that originated from = OpenSolaris (and >> hopefully only for them). >> The change: >> opensolaris code: translate INVARIANTS to DEBUG and ZFS_DEBUG >> do this by forcing inclusion of >> sys/cddl/compat/opensolaris/sys/debug_compat.h >> via -include option into all source files from OpenSolaris. >> Note that this -include option must always be after -include = opt_global.h. >> Additionally, remove forced definition of DEBUG for some modules = and fix >> their build without DEBUG. >> Also, meaning of DEBUG was overloaded to enable WITNESS support for = some >> OpenSolaris (primarily ZFS) locks. Now this overloading is removed = and >> that use of DEBUG is replaced with a new option = OPENSOLARIS_WITNESS. >> http://people.freebsd.org/~avg/osol-invariants-debug.diff >> I would like to ask for your feedback on the soundness of the whole = idea. >> Also on the name, location and style of inclusion for >> sys/cddl/compat/opensolaris/sys/debug_compat.h. >> And on any other details of the proposed change. >> Testing is also welcome, of course. >> Thank you very much. >=20 > I'm not sure you need #define ZFS_DEBUG as its already a dependency on > DEBUG see: > sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h >=20 > Should this connection be broken and INVARIANTS only trigger DEBUG by > default? One potential reason for this distinction is that ZFS_DEBUG = brings > with it some potentially quite heavy weight validation such as = dnode_verify. I would prefer to have INVARIANTS enable all of the ZFS invariant code, = not just the asserts. Folks already know that INVARIANTS means (sometimes quite significantly) lower performance. This is a small price to pay = for catching defects before a release. -- Justin=