From owner-freebsd-hackers@FreeBSD.ORG Sat Aug 7 19:19:02 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF2A71065674 for ; Sat, 7 Aug 2010 19:19:02 +0000 (UTC) (envelope-from freebsd-hackers@m.gmane.org) Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mx1.freebsd.org (Postfix) with ESMTP id 922908FC2A for ; Sat, 7 Aug 2010 19:19:02 +0000 (UTC) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Ohov6-0001dO-2n for freebsd-hackers@freebsd.org; Sat, 07 Aug 2010 21:19:00 +0200 Received: from 89-164-124-179.dsl.iskon.hr ([89.164.124.179]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 07 Aug 2010 21:19:00 +0200 Received: from ivoras by 89-164-124-179.dsl.iskon.hr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 07 Aug 2010 21:19:00 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-hackers@freebsd.org From: Ivan Voras Date: Sat, 07 Aug 2010 21:18:47 +0200 Lines: 19 Message-ID: References: <86fwyq8rsc.fsf@ds4.des.no> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 89-164-124-179.dsl.iskon.hr User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4 In-Reply-To: <86fwyq8rsc.fsf@ds4.des.no> 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 19:19:03 -0000 On 7.8.2010 15:40, Dag-Erling Smørgrav wrote: > 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. Ok, but still - if the underlying value really is declared as "int", doesn't it make perfect sense to have something like TUNABLE_INT for it? Forcing "long" is a bit weird in this context, as C long is 32-bit on i386 and 64-bit on amd64.