From patchwork Fri Apr 1 18:17:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Greear X-Patchwork-Id: 8726991 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 65CC0C0553 for ; Fri, 1 Apr 2016 18:17:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 84184203A1 for ; Fri, 1 Apr 2016 18:17:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 98687203AE for ; Fri, 1 Apr 2016 18:17:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752736AbcDASR3 (ORCPT ); Fri, 1 Apr 2016 14:17:29 -0400 Received: from mail2.candelatech.com ([208.74.158.173]:44102 "EHLO mail2.candelatech.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751124AbcDASR2 (ORCPT ); Fri, 1 Apr 2016 14:17:28 -0400 Received: from [192.168.100.149] (firewall.candelatech.com [50.251.239.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail2.candelatech.com (Postfix) with ESMTPSA id AFA3340EB60; Fri, 1 Apr 2016 11:17:27 -0700 (PDT) Subject: Re: Question on rhashtable in worst-case scenario. To: Herbert Xu , Johannes Berg References: <56F9941A.3080501@candelatech.com> <56FAAA6D.3070806@candelatech.com> <1459329252.2055.1.camel@sipsolutions.net> <20160330.123821.328761526754742195.davem@davemloft.net> <56FC0445.6010200@candelatech.com> <1459410405.4576.8.camel@sipsolutions.net> <20160331075015.GA27716@gondor.apana.org.au> <1459438199.4576.26.camel@sipsolutions.net> <20160401004627.GA9367@gondor.apana.org.au> Cc: David Miller , linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, tgraf@suug.ch From: Ben Greear Organization: Candela Technologies Message-ID: <56FEBB36.4020606@candelatech.com> Date: Fri, 1 Apr 2016 11:17:26 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <20160401004627.GA9367@gondor.apana.org.au> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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: 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 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),