[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <063D6719AE5E284EB5DD2968C1650D6D1CAED645@AcuExch.aculab.com>
Date: Wed, 25 Feb 2015 17:49:35 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Eric Dumazet' <eric.dumazet@...il.com>,
Daniel Borkmann <daniel@...earbox.net>
CC: "davem@...emloft.net" <davem@...emloft.net>,
"tgraf@...g.ch" <tgraf@...g.ch>,
"pablo@...filter.org" <pablo@...filter.org>,
"johunt@...mai.com" <johunt@...mai.com>,
"kaber@...sh.net" <kaber@...sh.net>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: RE: [PATCH net 2/2] rhashtable: remove indirection for grow/shrink
decision functions
From: Eric Dumazet
...
> 1) Automatic shrinking is a non issue. This will free very little
> memory, compared to previous peak usage (including objects put in
> rhashtable). If hash grown to a certain point, it's likely it will grow
> again later.
FWIW I tend to agree.
> 2) Growing can be triggered when any bucket has more than X elems, and
> that is given for free at insert time.
> X could be log2(buckets)/2 I guess. (aka shift/2)
That won't work if someone is managing to break the hash function.
You need some approximation to the total count as well.
OTOH there is no point growing the table if the current list isn't 'full'.
> A global limit on number of elements should be controlled by rhashtable
> users - if needed -, not in the rhashtable itself.
Possibly you could require the user to give an approximation of the
number of elements.
David
Powered by blists - more mailing lists