From owner-freebsd-hackers@FreeBSD.ORG Sat Aug 7 13:57:43 2010 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 137E8106564A; Sat, 7 Aug 2010 13:57:41 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id F0C018FC1D; Sat, 7 Aug 2010 13:57:40 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 44CE21FFC33; Sat, 7 Aug 2010 13:40:35 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 203E78454C; Sat, 7 Aug 2010 15:40:35 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Garrett Cooper References: Date: Sat, 07 Aug 2010 15:40:35 +0200 In-Reply-To: (Garrett Cooper's message of "Fri, 6 Aug 2010 23:48:19 -0700") Message-ID: <86fwyq8rsc.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: hackers@freebsd.org Subject: Re: Why is TUNABLE_INT discouraged? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Aug 2010 13:57:43 -0000 Garrett Cooper writes: > I found the commit where it was made (by des@ -- cvs revision > 1.120), but unfortunately I lack the context as to why that suggestion > is made; the commit isn't very explicit as to why integers tunables > should be discouraged You're supposed to use TUNABLE_LONG or TUNABLE_ULONG instead. From digging in the -current archives, it seems that the motivation was a bug that resulted from using a TUNABLE_INT for a value that was actually an address. It was doubly broken: first because it was too small on 64-bit systems, and second because it was signed. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no