Andi Kleen 4440095c82 SYSCTL: Print binary sysctl warnings (nearly) only once
When printing legacy sysctls print the warning message
for each of them only once.  This way there is a guarantee
the syslog won't be flooded for any sane program.

The original attempt at this made the tables non const and stored
the flag inline.

Linus suggested using a separate hash table for this, this is based on a
code snippet from him.

The hash implies this is not exact and can sometimes not print a
new sysctl due to a hash collision, but in practice this should not
be a problem

I used a FNV32 hash over the binary string with a 32byte bitmap. This
gives relatively little collisions when all the predefined binary sysctls
are hashed:

size 256
bucket
length      number
0:          [25]
1:          [67]
2:          [88]
3:          [47]
4:          [22]
5:          [6]
6:          [1]

The worst case is a single collision of 6 hash values.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
2009-12-23 21:00:20 +01:00
..
2009-09-21 14:29:21 +02:00
2009-12-22 14:10:37 -08:00
2009-12-15 08:53:10 -08:00
2009-06-24 00:02:38 -04:00
2009-12-22 12:27:34 -05:00
2009-10-29 07:39:25 -07:00
2009-12-06 21:10:56 +01:00
2009-09-18 09:48:52 -07:00
2009-06-16 19:47:48 -07:00
2009-12-14 23:55:34 +01:00
2009-12-22 14:17:56 -08:00
2009-07-24 10:53:29 +02:00
2009-06-18 13:03:56 -07:00
2009-12-16 10:23:43 -08:00
2009-12-17 15:45:32 -08:00
2009-12-09 10:03:07 +01:00
2009-12-20 19:05:02 +01:00
2009-12-20 23:31:23 +01:00
2009-10-26 09:40:30 +01:00
2009-07-12 14:03:27 -07:00
2009-12-22 14:10:37 -08:00
2009-09-23 18:13:10 -07:00
2009-11-02 16:02:39 +01:00
2009-06-18 13:03:55 -07:00