All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Florian Westphal <fw@strlen.de>, netdev@vger.kernel.org
Subject: Re: [PATCH net-next] rhashtable: remove insecure_max_entries param
Date: Tue, 25 Apr 2017 13:23:56 +0200	[thread overview]
Message-ID: <20170425112356.GB11322@breakpoint.cc> (raw)
In-Reply-To: <20170425110415.GA25167@gondor.apana.org.au>

Herbert Xu <herbert@gondor.apana.org.au> wrote:
> Florian Westphal <fw@strlen.de> wrote:
> > no users in the tree, insecure_max_entries is always set to
> > ht->p.max_size * 2 in rhtashtable_init().
> > 
> > Replace only spot that uses it with a ht->p.max_size check.
> 
> I'd suggest that as this needs to be computed every time we insert
> an element that you keep the value in struct rhashtable, but as an
> internal value as opposed to a paramter that is set by the user.

What extra cost?

The only change is that ht->nelems has to be right-shifted by one,
I don't think that warrants extra space in struct rhashtable, its
already way too large (I think we can reduce its size further).

Thanks,
Florian

  reply	other threads:[~2017-04-25 11:24 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-25  9:41 [PATCH net-next] rhashtable: remove insecure_max_entries param Florian Westphal
2017-04-25 11:04 ` Herbert Xu
2017-04-25 11:23   ` Florian Westphal [this message]
2017-04-25 13:28     ` Herbert Xu
2017-04-25 14:17       ` Florian Westphal
2017-04-25 14:48         ` David Miller
2017-04-27  5:44           ` rhashtable - Cap total number of entries to 2^31 Herbert Xu
2017-04-27 10:11             ` Florian Westphal
2017-04-27 10:13               ` Herbert Xu
2017-04-27 15:48             ` David Miller
2017-04-27 21:16             ` Florian Fainelli
2017-04-27 22:21               ` Florian Fainelli
2017-04-27 22:28                 ` [PATCH net-next] rhashtable: Make sure max_size is non zero Florian Fainelli
2017-04-27 22:32                   ` Florian Fainelli
2017-04-27 22:30                 ` Florian Fainelli
2017-04-28  6:10                   ` [PATCH net-next] rhashtable: Do not lower max_elems when max_size is zero Herbert Xu
2017-04-28 14:14                     ` David Miller
2017-04-28 15:42                       ` Florian Fainelli
2017-04-28 10:23                 ` rhashtable - Cap total number of entries to 2^31 Christian Borntraeger
2017-04-28 11:31                   ` Herbert Xu
2017-04-28 11:43                     ` Christian Borntraeger
2017-04-28  2:10             ` [lkp-robot] [rhashtable ] df7008bdd5: Kernel_panic-not_syncing:rtnetlink_init:cannot_initialize_rtnetlink kernel test robot
2017-04-28  2:10               ` kernel test robot
2017-04-26 18:39 ` [PATCH net-next] rhashtable: remove insecure_max_entries param David Miller

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=20170425112356.GB11322@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=herbert@gondor.apana.org.au \
    --cc=netdev@vger.kernel.org \
    /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.