netdev.vger.kernel.org archive mirror
 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 16:17:49 +0200	[thread overview]
Message-ID: <20170425141749.GD11322@breakpoint.cc> (raw)
In-Reply-To: <20170425132837.GA25657@gondor.apana.org.au>

Herbert Xu <herbert@gondor.apana.org.au> wrote:
> On Tue, Apr 25, 2017 at 01:23:56PM +0200, Florian Westphal wrote:
> >
> > 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).
> 
> I see at least one hole on 64-bit which means that you can fit
> it into struct rhashtable for free.

I'd rather close that hole by removing more stuff from rhastable and
rhashtable_params structs instead.

F.e. why do we need to have two key_len (one in params, one in
struct rhashtable)?

Or why does rhashtable use size_t in rhashtable_params to e.g. store
a key offset? Just using 'unsigned int' instead would shrink
rhashtable_params by 16 bytes.

I'd have less of an issue with this if we'd be talking about
something computationally expensive, but this is about storing
an extra value inside a struct just to avoid one "shr" in insert path...

  reply	other threads:[~2017-04-25 14:17 UTC|newest]

Thread overview: 23+ 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
2017-04-25 13:28     ` Herbert Xu
2017-04-25 14:17       ` Florian Westphal [this message]
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-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=20170425141749.GD11322@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 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).