Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Aug 2010 01:08:48 -0700
From:      Garrett Cooper <gcooper@FreeBSD.org>
To:        =?ISO-8859-1?Q?Dag=2DErling_Sm=F8rgrav?= <des@des.no>
Cc:        freebsd-hackers@freebsd.org, Ivan Voras <ivoras@freebsd.org>
Subject:   Re: Why is TUNABLE_INT discouraged?
Message-ID:  <AANLkTimbkTQiNgYCYFnTXMpRe9koJGrq1%2BYoq5-fVmFD@mail.gmail.com>
In-Reply-To: <8662zkurx9.fsf@ds4.des.no>
References:  <AANLkTinKaiGFhKRgqQ%2BFjm=02VfWCxULe0a68y-PkJx6@mail.gmail.com> <86fwyq8rsc.fsf@ds4.des.no> <i3kbis$73l$1@dough.gmane.org> <86d3tujh72.fsf@ds4.des.no> <AANLkTi=puD%2B-WeZ%2BFGdtZtw1v%2BNnGD_htwNa%2BEn9fcML@mail.gmail.com> <864of680wv.fsf@ds4.des.no> <AANLkTinraF50O%2Bcp_h1m6TODnoz_7R3WXfjTanh-86mn@mail.gmail.com> <AANLkTikU6fLzWL-n6fCtvaTsXWGis7ydKM1qJaV=WRJ%2B@mail.gmail.com> <8662zkurx9.fsf@ds4.des.no>

next in thread | previous in thread | raw e-mail | index | archive | help
2010/8/9 Dag-Erling Sm=F8rgrav <des@des.no>:
> Garrett Cooper <gcooper@FreeBSD.org> writes:
>> Why would someone express a tunable in a memory address (not being
>> sarcastic... I just don't see why it makes sense right now, but if
>> there's a valid reason I'm more than happy to be educated :)..)?
>
> A few examples:
>
> hw.acpi.host_mem_start
> hw.pci.host_mem_start
> hw.physmemstart
>
> The following are not addresses, but can be > 32 bits on 64-bit machines
> and even on some 32-bit machines using PAE / PTE:
>
> hw.physmem
> vm.kmem_size
> vm.kmem_size_max
> vm.kmem_size_min

Ok -- good to know.

> It might be a good idea to introduce TUNABLE_POINTER and TUNABLE_SIZE.

I would actually argue against doing that because it would only create
divergence between sysctl and tunable KPIs... but that's just me. The
patch I provided before would converge sysctl and tunables a bit more
(and I'd more than happily submit patches for the other missing cases
on the sysctl side to get parity with the tunables). If it makes sense
to add the sysctls _and_ the tunables for POINTER and SIZE though,
I'll provide a patch for both cases in one shot.

(BTW, when you say TUNABLE_SIZE, I assume it would be a size_t quantity?)

Something might need to be done to the values returned by the tunables
though, because they don't respect boundaries, and can overflow right
now (which exacerbates the issue with values crammed into smaller
datatypes)...

Thanks!
-Garrett



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTimbkTQiNgYCYFnTXMpRe9koJGrq1%2BYoq5-fVmFD>