Hi, On Tue, 17 Jun 2014 09:43:07 +0200 Claudio Jeker <cje...@diehard.n-r-g.com> wrote: > 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 resizing the hash tables is better than replacing with RB tree. Hash pros: - faster - not so big - easy to understand and customize(eg. adding lock for parallel) cons: - need rehash when growing up --yasuoka