Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp362091imm; Thu, 13 Sep 2018 22:55:08 -0700 (PDT) X-Google-Smtp-Source: ANB0VdahTZ0SbmUG0uBD1Aiz5lcQqx4pkWwML5AIv4qdb4cp8nOh2Owyjj0Pt28MeqYXeJ7ccFFJ X-Received: by 2002:a17:902:c6:: with SMTP id a64-v6mr10458518pla.180.1536904508438; Thu, 13 Sep 2018 22:55:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536904508; cv=none; d=google.com; s=arc-20160816; b=H6TQape8IAWPmrMFOD3EY5asZYAOWhg+URIVfmkpNmbXrkDZx3mYixptKBOrndSxL4 cQDmviiVFpi2PYI74ad5Bt/D8fejGW2b1Zhpal+QjmyLwARbqOU0pHZPJNlw1js3fvQZ UKTXzSCJNmIM5Jr9Nz1IdSSXinH41CWHmuLdhozyjG9Sjf+nTGYYd5+G6usA/hjuNmFw uiYpLa98mESkbHgQfxLDDnNGx8V163G9VWUljyHK0dmL1vIucsyNd3dw7pCjJkv1xsl6 j2PK4dlqGfNY8/QTjreLHDXu7JvLis1Lya/96q8aw1mIckFTmW60blSFTCfP+0GTeFwh 5Klw== 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=IWdXEOnWeUXbCjxY2qWwulKPQvjsMogDaYJRhNXIc9U=; b=Jt8eINTpQCjbuyZ1nfAeSGGO6vQ+e2oRk+HmDIgD2DzELRbxNBDqdnLlwAgwF/9aQ7 mlNG9jufVeWVMqSuX8m5hpHaeQZnqrVIgl9/Pwn2ij3bqCszB/olAdG+L5pdUoBQ34Ie fvWr+xGgcLj1YxJqnbW/WGLD4/jDLz4R1j28odrmVkkjn3i9EtBcrUUpci3uicFnNxEE 66V4QnjJkoZy15lNWBLh8mlHceaFqlRy8lxoHftzeILovuOK7F+RcXl1zNC62v6Fe4ei AfzOaaPLSExcxbyOOjDcddVJgveHtogJyRrGqg5a7qPYK7WzD7TNTLUek84gEA/GdWlQ rjkA== 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 22-v6si6457982pfb.215.2018.09.13.22.54.52; Thu, 13 Sep 2018 22:55:08 -0700 (PDT) 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 S1727300AbeINLHe (ORCPT + 99 others); Fri, 14 Sep 2018 07:07:34 -0400 Received: from Chamillionaire.breakpoint.cc ([146.0.238.67]:37948 "EHLO Chamillionaire.breakpoint.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726822AbeINLHe (ORCPT ); Fri, 14 Sep 2018 07:07:34 -0400 Received: from fw by Chamillionaire.breakpoint.cc with local (Exim 4.89) (envelope-from ) id 1g0h3t-00048m-7s; Fri, 14 Sep 2018 07:54:37 +0200 Date: Fri, 14 Sep 2018 07:54:37 +0200 From: Florian Westphal To: Steffen Klassert Cc: Florian Westphal , David Miller , linux@stwm.de, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, torvalds@linux-foundation.org, christophe.gouault@6wind.com Subject: Re: Regression: kernel 4.14 an later very slow with many ipsec tunnels Message-ID: <20180914055437.77pffp2jrbfnykbp@breakpoint.cc> References: <20180913135844.3ut6fxgx67t6ndtu@breakpoint.cc> <3448099.9yk84El3Sa@stwm.de> <20180913163848.ni5xc4gc4d6uusdn@breakpoint.cc> <20180913.102305.939671149040995911.davem@davemloft.net> <20180913210325.5usfj2rorvuvtyc7@breakpoint.cc> <20180914050651.GD23674@gauss3.secunet.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180914050651.GD23674@gauss3.secunet.de> 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 Steffen Klassert wrote: > On Thu, Sep 13, 2018 at 11:03:25PM +0200, Florian Westphal wrote: > > David Miller wrote: > > > From: Florian Westphal > > > Date: Thu, 13 Sep 2018 18:38:48 +0200 > > > > > > > Wolfgang Walter wrote: > > > >> What I can say is that it depends mainly on number of policy rules and SA. > > > > > > > > Thats already a good hint, I guess we're hitting long hash chains in > > > > xfrm_policy_lookup_bytype(). > > > > > > I don't really see how recent changes can influence that. > > > > I don't think there is a recent change that did this. > > > > Walter says < 4.14 is ok, so this is likely related to flow cache removal. > > > > F.e. it looks like all prefixed policies end up in a linked list > > (net->xfrm.policy_inexact) and are not even in a hash table. > > > > I am staring at b58555f1767c9f4e330fcf168e4e753d2d9196e0 > > but can't figure out how to configure that away from the > > 'no hashing for prefixed policies' default or why we even have > > policy_inexact in first place :/ > > The hash threshold can be configured like this: > > ip x p set hthresh4 0 0 > > This sets the hash threshold to local /0 and remote /0 netmasks. > With this configuration, all policies should go to the hashtable. Yes, but won't they all be hashed to same bucket? [ jhash(addr & 0, addr & 0) ] ? > Default hash thresholds are local /32 and remote /32 netmasks, so > all prefixed policies go to the inexact list. Yes. Wolfgang, before having to work on getting perf into your router image can you perhaps share a bit of info about the policies you're using? How many are there? Are they prefixed or not ("10.1.2.1")?