From: Ben Greear <greearb@candelatech.com>
To: Herbert Xu <herbert@gondor.apana.org.au>,
Johannes Berg <johannes@sipsolutions.net>
Cc: David Miller <davem@davemloft.net>,
linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org,
netdev@vger.kernel.org, tgraf@suug.ch
Subject: Re: Question on rhashtable in worst-case scenario.
Date: Fri, 1 Apr 2016 11:17:26 -0700 [thread overview]
Message-ID: <56FEBB36.4020606@candelatech.com> (raw)
In-Reply-To: <20160401004627.GA9367@gondor.apana.org.au>
On 03/31/2016 05:46 PM, Herbert Xu wrote:
> On Thu, Mar 31, 2016 at 05:29:59PM +0200, Johannes Berg wrote:
>>
>> Does removing this completely disable the "-EEXIST" error? I can't say
>> I fully understand the elasticity stuff in __rhashtable_insert_fast().
>
> What EEXIST error are you talking about? The only one that can be
> returned on insertion is if you're explicitly checking for dups
> which clearly can't be the case for you.
>
> If you're talking about the EEXIST error due to a rehash then it is
> completely hidden from you by rhashtable_insert_rehash.
>
> If you actually meant EBUSY then yes this should prevent it from
> occurring, unless your chain-length exceeds 2^32.
EEXIST was on removal, and was a symptom of the failure to insert, not
really a problem itself.
I reverted my revert (ie, back to rhashtable), added Johanne's patch
to check insertion (and added my on pr_err there).
I also added this:
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index 38ef0be..c25b945 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -66,6 +66,7 @@
static const struct rhashtable_params sta_rht_params = {
.nelem_hint = 3, /* start small */
+ .insecure_elasticity = true, /* Disable chain-length checks. */
.automatic_shrinking = true,
.head_offset = offsetof(struct sta_info, hash_node),
.key_offset = offsetof(struct sta_info, addr),
Now, my test case seems to pass, though I did have one strange issue
before I put in the pr_err. I'm not sure if it was a hashtable issue
or something else..but I have lots of something-else going on in this system,
so I'd say that likely the patch above fixes rhashtable for my use case.
I will of course let you know if I run into more issues that appear
to be hashtable related!
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
next prev parent reply other threads:[~2016-04-01 18:17 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-28 20:29 Question on rhashtable in worst-case scenario Ben Greear
2016-03-29 16:16 ` Ben Greear
2016-03-30 9:14 ` Johannes Berg
2016-03-30 13:55 ` Herbert Xu
2016-03-30 14:03 ` Johannes Berg
2016-03-30 14:09 ` Herbert Xu
2016-03-30 16:38 ` David Miller
2016-03-30 16:52 ` Ben Greear
2016-03-31 7:46 ` Johannes Berg
2016-03-31 7:50 ` Herbert Xu
2016-03-31 15:29 ` Johannes Berg
2016-04-01 0:46 ` Herbert Xu
2016-04-01 18:17 ` Ben Greear [this message]
2016-04-01 21:34 ` Johannes Berg
2016-04-02 1:46 ` Herbert Xu
2016-04-02 18:33 ` Johannes Berg
2016-03-31 15:13 ` Ben Greear
2016-03-31 15:22 ` Johannes Berg
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=56FEBB36.4020606@candelatech.com \
--to=greearb@candelatech.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=johannes@sipsolutions.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@vger.kernel.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 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).