Linux cryptographic layer development
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: kadlec@netfilter.org, linux-crypto@vger.kernel.org
Subject: Re: [v5 PATCH] rhashtable: Add rhashtable_flush_and_free helper
Date: Mon, 14 Sep 2026 16:54:58 +0200	[thread overview]
Message-ID: <aqgKwiRQ5oz-Mwc-@strlen.de> (raw)
In-Reply-To: <aqfPeIDmYPI8-ZTb@gondor.apana.org.au>

Herbert Xu <herbert@gondor.apana.org.au> wrote:
> On Mon, Sep 14, 2026 at 12:16:32PM +0200, Florian Westphal wrote:
> >
> > Thanks, I rebased the ipset rhashtable conversion patches
> > on top of this; all tests pass.
> 
> Please take this patch via your series as I don't to add features
> to the kernel without a user.

Will do, thanks!  One minor nit:
rhashtable_rehash_table() has a comment that still referts to
rcu_head_after_call_rcu.

Are you OK with this small change?

diff --git a/lib/rhashtable.c b/lib/rhashtable.c
index 63129a8e223b..511383708e19 100644
--- a/lib/rhashtable.c
+++ b/lib/rhashtable.c
@@ -358,8 +358,8 @@ static int rhashtable_rehash_table(struct rhashtable *ht)
         * table, and thus no references to the old table will
         * remain.
         * We do this inside the locked region so that
-        * rhashtable_walk_stop() can use rcu_head_after_call_rcu()
-        * to check if it should not re-link the table.
+        * rhashtable_walk_stop() can check tbl->dying before it
+        * re-links the table.
         */

I can mangle this locally here.

> > > Once rehashes are completely gone, ht->nelems is reset to zero,
> > > and the new table is installed.
> > 
> > Wrt. to this, you could do:
> 
> The problem with this is that during the flush, nelems will be out
> of whack with reality which will cause rhashtable to do grow the
> hashtable unnecessarily, followed by a sudden shrinking.

Right, lets go with rejecting insertions then.

  reply	other threads:[~2026-09-14 14:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-12 10:16 [v2 PATCH] rhashtable: Add rhashtable_flush_and_free helper Herbert Xu
2026-09-12 18:32 ` Florian Westphal
2026-09-12 23:27   ` Herbert Xu
2026-09-13  0:12     ` [v3 " Herbert Xu
2026-09-13  1:34       ` [v4 " Herbert Xu
2026-09-13  2:53         ` [v5 " Herbert Xu
2026-09-13  6:31           ` Florian Westphal
2026-09-14 10:16           ` Florian Westphal
2026-09-14 10:42             ` Herbert Xu
2026-09-14 14:54               ` Florian Westphal [this message]
2026-09-15  4:49                 ` Herbert Xu
2026-09-15  5:45                   ` Herbert Xu

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=aqgKwiRQ5oz-Mwc-@strlen.de \
    --to=fw@strlen.de \
    --cc=herbert@gondor.apana.org.au \
    --cc=kadlec@netfilter.org \
    --cc=linux-crypto@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