On Mon, Jan 07, 2008 at 09:30:54PM +0000, Alan Cox wrote:
One thing I'm worrying about is memory bloat (yes I know that's not
popular but someone has to do it ;-)
You would need a hash table for each table. To handle 100k entries
you would need a larger hash tables with at least a few hundred entries.
And that for each subdirectory.
% find /proc/sys -type d | wc -l
64
Assuming e.g. a 128 byte entry hash table (which is probably too small
for 100k entries) that would require 64 * 128 * 8 = 64k of memory.
Not gigantic, but lots of small fry bloat also adds up. Now if you
chose an actually realistic hash table size it gets even bigger.
Most likely you would need to implement a tree or a resizeable hash table
to do this sanely and then you quickly go into complicated territory.
My understanding was that the code was always on; not only for debugging.
-Andi
--