Subject: Re: [PATCH] HTB O(1) class lookup

From: jamal <[email-masked]>
Date: Thu, 01 Feb 2007 08:06:24 -0500

On Thu, 2007-01-02 at 07:08 +0100, Patrick McHardy wrote:

> 
> I have a patch for HFSC which introduces dynamic resizing of the
> class hash. 

One thing that has bitten me recently was tests to try and see how far i
can go insert xfrm SAD/SPDs - the resizing of the hashes kept allocing
more and more space until i ran out of memory, then swap took over and
hell broke loose. It would be nice in your approach to keep a
configurable upper bound on how much mem a hash table can chew.

> I have planned to generalize it (similar to tcf_hashinfo)
> and convert HTB and CBQ as well, which as a nice side effect will
> allow to get rid of some duplicated code, like hash walking.
> 

You know what would be really nice is a generic piece of code that would
apply for all sorts of netcode that uses hashes (theres a huge amount of
such code) and then converting over slowly all users to it: All
attributes to such hashes are known, max-size, hash() etc. The
tcf_hashinfo is a good start template for such an effort.

cheers,
jamal