netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH net 2/2] rhashtable: remove indirection for grow/shrink decision functions
@ 2015-02-25 22:09 Alexei Starovoitov
  2015-02-26  7:53 ` Patrick McHardy
  0 siblings, 1 reply; 11+ messages in thread
From: Alexei Starovoitov @ 2015-02-25 22:09 UTC (permalink / raw)
  To: Patrick McHardy
  Cc: Eric Dumazet, Daniel Borkmann, David Laight, davem@davemloft.net,
	tgraf@suug.ch, pablo@netfilter.org, johunt@akamai.com,
	netdev@vger.kernel.org

On Wed, Feb 25, 2015 at 12:10 PM, Patrick McHardy <kaber@trash.net> wrote:
> On 25.02, Eric Dumazet wrote:
>> But if any workload had to grow the table to 2^20 slots, we had to
>> consume GB of memory anyway to hold sockets and everything.
>>
>> Trying to shrink is simply not worth it, unless you expect your host
>> never reboots and you desperately need back these 8 MBytes of memory.
>
> That may be true in the TCP case, but for not for nftables. We might
> have many sets and, especially when used to represent more complicated
> classification algorithms, their size might change by a lot.

sounds like grow/shrink decision cannot be generalized within
rhashtable, but two callbacks are about to be removed and the
are costly. So would it make sense to disable auto-expand/shrink
completely and let nft/tcp call expand/shrink when needed?
nft can potentially do smarter batching this way.
If it sees a lot of entries are about to be inserted, it can call
expand directly to quickly grow sparsely populated table
into large one, and then insert all the entries.
That will mitigate 'slow rcu' issue as well.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2015-02-27 22:55 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-25 22:09 [PATCH net 2/2] rhashtable: remove indirection for grow/shrink decision functions Alexei Starovoitov
2015-02-26  7:53 ` Patrick McHardy
2015-02-26  8:54   ` Daniel Borkmann
2015-02-26 14:50   ` Eric Dumazet
2015-02-26 14:54     ` Patrick McHardy
2015-02-26 15:20     ` [PATCH net] rhashtable: use cond_resched() Eric Dumazet
2015-02-26 15:36       ` David Laight
2015-02-26 15:46         ` Patrick McHardy
2015-02-26 16:03           ` David Laight
2015-02-26 15:50       ` Daniel Borkmann
2015-02-27 22:55       ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).