Why is TUNABLE_INT discouraged?

Dag-Erling Smørgrav des at des.no
Sat Aug 7 13:57:43 UTC 2010

Garrett Cooper <gcooper at FreeBSD.org> 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.

Dag-Erling Smørgrav - des at des.no

More information about the freebsd-hackers mailing list