On Mon, Jun 16, 2014 at 11:35:07AM -0600, Theo de Raadt wrote:
> > > Followings are our kernel variables' default:
> > > 
> > >   - sb_max: 256K
> > >   - tcbhash_size: 128
> > >   - udbhash_size: 128
> > > 
> > > These variables are sometime too small for busy server or gateway.
> > > 
> > > I'd like to modify config(8) to customize these variables without
> > > recompiling the kernel. 
> > 
> > If we go this route, I would rather have a generic command (such as "set
> > <kernel variable name> <value>") to change kernel variables.
> > 
> > The list of said variables would still be restricted to what a given
> > config(8) knows, to prevent people from tinkering with things they are
> > not supposed to touch.
> 
> 
> I quite dislike the direction this is going.
> 
> It seems like you have found 3 variables which should auto-tune.
> So why not write kernel code to auto-tune them?
> 

We could replace the hashes with RB trees. I think that would be better
than having to rehash the list. To tune sb_max we need a way to have
memory limits so that the socket buffers don't consume all the resources
and starve the kernel out of memory. 
I think implementing the RB tree is fairly trivial (I did this once 10
years ago) but resource management is a fair bit more work.

-- 
:wq Claudio

Reply via email to