Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp319584imu; Wed, 12 Dec 2018 17:44:50 -0800 (PST) X-Google-Smtp-Source: AFSGD/WX1HPK5IY4IlsltIBfklmUPIRasdHXlQ+33y93wgb1V+nXcDxPFoFuPXE7jFBUicb1OIXa X-Received: by 2002:a63:c051:: with SMTP id z17mr19885112pgi.20.1544665490493; Wed, 12 Dec 2018 17:44:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544665490; cv=none; d=google.com; s=arc-20160816; b=Lu7zRhLN515+eS4U7B9TxBIL1ynvAzw4JOI+2DJRaoT5b0LPszZywOlp2GdFpNPEfa ACwGLiZZLDiVhwMhS54setgBlxChZFN7lsT2BAKgFD5eXLZumgOSnMeXtyNGgqQu9KHO WEqbTdgrn32Vct9Hcys5k+Rp8zw0hITyyP2Bc/yySDs+Fdm62+1fWNnAUJk70jk6JjKl ajJFiwV+dtV5J7H2CvHchUCeECXoWW4j2kFMVNNFbCgZ1GvOjcmt7CE6GQ6d8o/KJgXb im4vwRow7Aznq7XyaF1YlUbwrH2Q3NjP3wEcGm8CbNjqh/Pp26jaQOzQFGx8zl+dnJpJ UprA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Bie+jGcRaVI2ClhpIs6JLbai1XTTezeQ8faKpQJzVNQ=; b=Cwy9YpmeYZGEHJ6RsYWcPSy37dr/EfJDcwDx5BIw7t9iVcmPRGp0zOUEInEkbDvuCm uqLznoysffq1zAKAC+gaciWskULeRM3jelt/7befpoX0G06qJF1uUsBzjl3FcP4V9Iv5 XtfjeDJNxxynJpwEhsX7fvBC7U9kW+9dA22cONAqKDfNbu1nIPj8dX9w8rjtGFEuKzxM R9kMg4YbmqMaoCjFu4UcxAbTxuD8+H0opDevpotP84ujRtqBYdd4l+Rfd0c7XGfgYFA2 Dt+d3977nDZV2Sctz7MPhhscfdLM8If4nIZIBj98EnGgluGTutV897XRaBDacOqz0Vfr eMyA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m61si363136plb.154.2018.12.12.17.44.14; Wed, 12 Dec 2018 17:44:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726554AbeLMBnW (ORCPT + 99 others); Wed, 12 Dec 2018 20:43:22 -0500 Received: from orcrist.hmeau.com ([104.223.48.154]:49018 "EHLO deadmen.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726372AbeLMBnW (ORCPT ); Wed, 12 Dec 2018 20:43:22 -0500 Received: from gondobar.mordor.me.apana.org.au ([192.168.128.4] helo=gondobar) by deadmen.hmeau.com with esmtps (Exim 4.89 #2 (Debian)) id 1gXG1y-00011o-VH; Thu, 13 Dec 2018 09:43:15 +0800 Received: from herbert by gondobar with local (Exim 4.89) (envelope-from ) id 1gXG1t-0003i6-Uy; Thu, 13 Dec 2018 09:43:09 +0800 Date: Thu, 13 Dec 2018 09:43:09 +0800 From: Herbert Xu To: NeilBrown Cc: Thomas Graf , Tom Herbert , David Miller , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next] rhashtable: further improve stability of rhashtable_walk Message-ID: <20181213014309.uufaeoijhympgxbz@gondor.apana.org.au> References: <153086109256.2825.15329014177598382684.stgit@noble> <87zhtkeimx.fsf@notabene.neil.brown.name> <20181207053943.7zacyn5uvqkfnfoi@gondor.apana.org.au> <87k1kico1o.fsf@notabene.neil.brown.name> <20181211051755.modgomqzszkbiihe@gondor.apana.org.au> <87mupbvch0.fsf@notabene.neil.brown.name> <20181212054601.wbzpxjunnsfi62mz@gondor.apana.org.au> <87efanuu06.fsf@notabene.neil.brown.name> <20181212080037.j2zs22t57uxdu2jr@gondor.apana.org.au> <87bm5ruo3f.fsf@notabene.neil.brown.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87bm5ruo3f.fsf@notabene.neil.brown.name> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 12, 2018 at 07:49:08PM +1100, NeilBrown wrote: > On Wed, Dec 12 2018, Herbert Xu wrote: > > > On Wed, Dec 12, 2018 at 05:41:29PM +1100, NeilBrown wrote: > >> > >> So you would substantially slow down the rhashtable_walk_start() step. > > > > This whole thing is meant for uses such as /proc and netlink > > enumeration. Speed is definitely not a prerogative of these > > iterators. > > An RCU grace period is typically 10s of milliseconds. It doesn't take > very many of those to start being noticed. Why would you even need an RCU grace period for deleting and adding the walker object to the bucket list? You just allocate a new one each time and free the old one after an RCU grace period. I don't see where the latency is coming from. > > For that matter, if speed was an issue then surely you would > > not drop out of the RCU read lock at all while iterating. > > tipc_nl_sk_walk() drops out of RCU for every object. > I don't know what it is used for, but I doubt that making it thousands > of times slower would be a good thing. Now you're conflating two different things. Dropping the RCU isn't necessarily slow. We were talking about waiting for an RCU grace period which would only come into play if you were suspending the walk indefinitely. Actually as I said above even there you don't really need to wait. > > It sounds to me like you're trying to use this interface for > > something that it's simply not designed to do. > > I'm just trying to make sure we have a reliable data structure which I > can use without having to be worried that I might accidentally hit some > unsupported behaviour. Now that is something I agree with. > I don't really see why you think my patch is all that complex. > The only conceptual change is that hash chains are now ordered, and > ordered chains are easy to understand. > The biggest part of the code change is just moving some code from > rhashtable_walk_start() to rhashtable_walk_next(). > > Why don't you like it? My main beef is the fact that it doesn't work with rhlist. So down the track either we'll have to add more complexity for rhlist or we will have to rip this out again do something completely different. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt