All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox.net>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: David Laight <David.Laight@ACULAB.COM>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"tgraf@suug.ch" <tgraf@suug.ch>,
	"pablo@netfilter.org" <pablo@netfilter.org>,
	"johunt@akamai.com" <johunt@akamai.com>,
	"kaber@trash.net" <kaber@trash.net>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH net 2/2] rhashtable: remove indirection for grow/shrink decision functions
Date: Wed, 25 Feb 2015 19:56:08 +0100	[thread overview]
Message-ID: <54EE1AC8.6060206@iogearbox.net> (raw)
In-Reply-To: <1424886096.5565.104.camel@edumazet-glaptop2.roam.corp.google.com>

On 02/25/2015 06:41 PM, Eric Dumazet wrote:
...
> There is no need to track number of elements, using either an atomic_t
> or percpu_counter. This adds unnecessary burden.
>
> 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.

So you are saying that shrinking is most likely a rather undesirable
use-case in rhashtable?

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

Yes, I think such a facility can be added easily.

> A global limit on number of elements should be controlled by rhashtable
> users - if needed -, not in the rhashtable itself.

Makes sense, thanks for the suggestion! I'll experiment with the above
per bucket tracking a bit if you're okay with that, and also unfiddle
the rht counter internals from netlink.

Thanks,
Daniel

  parent reply	other threads:[~2015-02-25 18:56 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54EE1AC8.6060206@iogearbox.net \
    --to=daniel@iogearbox.net \
    --cc=David.Laight@ACULAB.COM \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=johunt@akamai.com \
    --cc=kaber@trash.net \
    --cc=netdev@vger.kernel.org \
    --cc=pablo@netfilter.org \
    --cc=tgraf@suug.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.