netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 0/2] rhashtable updates
@ 2015-02-25 15:31 Daniel Borkmann
  2015-02-25 15:31 ` [PATCH net 1/2] rhashtable: unconditionally grow when max_shift is not specified Daniel Borkmann
                   ` (2 more replies)
  0 siblings, 3 replies; 32+ messages in thread
From: Daniel Borkmann @ 2015-02-25 15:31 UTC (permalink / raw)
  To: davem; +Cc: tgraf, pablo, johunt, kaber, netdev, Daniel Borkmann

As discussed, I'm sending out rhashtable fixups for -net.

I have a couple of more patches I was working on last week pending,
i.e. to get rid of ht->nelems and ht->shift atomic operations which
speed-up pure insertions/deletions, e.g. on my laptop I have 2 threads,
inserting 7M entries each, that will reduce insertion time from ~1,450 ms
to 865 ms (performance should even be better after removing the
grow/shrink indirections). I guess that however is rather something
for net-next.

Thanks,
Daniel

Daniel Borkmann (2):
  rhashtable: unconditionally grow when max_shift is not specified
  rhashtable: remove indirection for grow/shrink decision functions

 include/linux/rhashtable.h | 13 -----------
 lib/rhashtable.c           | 58 ++++++++++++++--------------------------------
 lib/test_rhashtable.c      |  3 +--
 net/netfilter/nft_hash.c   |  2 --
 net/netlink/af_netlink.c   |  2 --
 net/tipc/socket.c          |  2 --
 6 files changed, 19 insertions(+), 61 deletions(-)

-- 
1.9.3

^ permalink raw reply	[flat|nested] 32+ messages in thread
* 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; 32+ 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] 32+ messages in thread

end of thread, other threads:[~2015-03-13  7:07 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-25 15:31 [PATCH net 0/2] rhashtable updates Daniel Borkmann
2015-02-25 15:31 ` [PATCH net 1/2] rhashtable: unconditionally grow when max_shift is not specified Daniel Borkmann
2015-02-25 16:28   ` Thomas Graf
2015-02-25 16:36     ` Daniel Borkmann
2015-02-25 16:44       ` Daniel Borkmann
2015-02-25 17:09         ` Thomas Graf
2015-02-25 15:31 ` [PATCH net 2/2] rhashtable: remove indirection for grow/shrink decision functions Daniel Borkmann
2015-02-25 15:41   ` David Laight
2015-02-25 15:46     ` Daniel Borkmann
2015-02-25 15:51       ` David Laight
2015-02-25 16:14         ` Daniel Borkmann
2015-02-25 17:41           ` Eric Dumazet
2015-02-25 17:49             ` David Laight
2015-02-25 18:15               ` Eric Dumazet
2015-02-25 18:56             ` Daniel Borkmann
2015-02-25 19:52               ` Eric Dumazet
2015-02-25 20:10                 ` Patrick McHardy
2015-02-26 10:02             ` tgraf
2015-02-27 22:30               ` David Miller
2015-02-28  0:48                 ` Patrick McHardy
2015-02-28  1:35                   ` David Miller
2015-02-26 14:18             ` David Laight
2015-03-11  6:42             ` Herbert Xu
2015-03-12 16:57               ` Thomas Graf
2015-03-13  7:06                 ` Herbert Xu
2015-02-25 17:23   ` Thomas Graf
2015-02-27 21:06 ` [PATCH net 0/2] rhashtable updates David Miller
  -- strict thread matches above, loose matches on Subject: below --
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

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).