Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp367851imm; Thu, 13 Sep 2018 23:01:59 -0700 (PDT) X-Google-Smtp-Source: ANB0VdY9ge+5UwJGywt2O+LAMKXNiGkybbdJJPQnlE2dhBz/sDPt7qQ5SpbCwDqAc72X/qyq+kgz X-Received: by 2002:a63:1064:: with SMTP id 36-v6mr10095955pgq.254.1536904919295; Thu, 13 Sep 2018 23:01:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536904919; cv=none; d=google.com; s=arc-20160816; b=LCB3zpBnysmNnSZtM7cqZwQBpLooiOb9NXd6pwX+gWz+YL9Zbbr/FzhAg8LrEzkyc2 FOCDkt2oKhBZvGIy1kFJmD23GjPzPjEGsSs9RXxYdbityuSyYtk/X5YU2BpO1A57tYFX o43XFJJvSKjeKqLI+sWLHRqnnTiyCRFYGVK5dqZxGtOA3m+cmeN3rp+syzpP+LjKa39w VvoBMAZzkDPPuwrpoUWHIy1aGbHGBTkD4UbaKMtMx6DVn5r/AcsnC58Tt9prsHDI7h1L 5+u/Hwprj12sEQIusCwBnGuilniFoAvT9UNacPtK3lBJh6d+v/aeZ2KRImE+mV6pWMPR CizQ== 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=6ug1Q/LQC8xK0xQsfq1thYTXYWUGs+R2umNuC2jK3rg=; b=PCB4yoPhfUxKBa6I2XNsuMdmIHnJij8g4v55LAVJxSuMlhJt3kEFFmdApgxyxgnjW6 oDNNpc7GOFg9uYM89cXIvMvpPVI3iqNc8mWOeLC6RWE0xwDtS1XMMlnz+CRsWppieUbH zN5cFHBiotTdMEZuZ2+iH7Srgqhuwta4VAPHI0OplwKhjTLpu9dBxTOIFp30DuTyea8J PicNtrDPg1N8VcQnNYXluqvyGDRaGDwvdHPGpjJnsTSSNp+Sz+bas5mJhxa1oZqsSZAX B4cumbK78rHUCdTCkgssB4Z84hihDsnTNdVeM19+XTUAkM7f034ZlLY+mBmQCbx458/N fUPw== 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 x4-v6si5804502plo.459.2018.09.13.23.01.42; Thu, 13 Sep 2018 23:01:59 -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 S1727128AbeINLOa (ORCPT + 99 others); Fri, 14 Sep 2018 07:14:30 -0400 Received: from a.mx.secunet.com ([62.96.220.36]:48716 "EHLO a.mx.secunet.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726845AbeINLOa (ORCPT ); Fri, 14 Sep 2018 07:14:30 -0400 Received: from localhost (localhost [127.0.0.1]) by a.mx.secunet.com (Postfix) with ESMTP id BF4E1201C4; Fri, 14 Sep 2018 10:01:17 +0200 (CEST) X-Virus-Scanned: by secunet Received: from a.mx.secunet.com ([127.0.0.1]) by localhost (a.mx.secunet.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8ct8xp0azJkv; Fri, 14 Sep 2018 10:01:16 +0200 (CEST) Received: from mail-essen-02.secunet.de (mail-essen-02.secunet.de [10.53.40.205]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a.mx.secunet.com (Postfix) with ESMTPS id 3A819201A1; Fri, 14 Sep 2018 10:01:16 +0200 (CEST) Received: from gauss2.secunet.de (10.182.7.193) by mail-essen-02.secunet.de (10.53.40.205) with Microsoft SMTP Server id 14.3.408.0; Fri, 14 Sep 2018 08:01:33 +0200 Received: by gauss2.secunet.de (Postfix, from userid 1000) id 078D1318060A; Fri, 14 Sep 2018 08:01:33 +0200 (CEST) Date: Fri, 14 Sep 2018 08:01:33 +0200 From: Steffen Klassert To: Florian Westphal CC: David Miller , , , , , Subject: Re: Regression: kernel 4.14 an later very slow with many ipsec tunnels Message-ID: <20180914060132.GE23674@gauss3.secunet.de> 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> <20180914055437.77pffp2jrbfnykbp@breakpoint.cc> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20180914055437.77pffp2jrbfnykbp@breakpoint.cc> User-Agent: Mutt/1.9.4 (2018-02-28) X-G-Data-MailSecurity-for-Exchange-State: 0 X-G-Data-MailSecurity-for-Exchange-Error: 0 X-G-Data-MailSecurity-for-Exchange-Sender: 23 X-G-Data-MailSecurity-for-Exchange-Server: cbe3d3f7-b9e3-4256-b890-f24c4306a01c X-EXCLAIMER-MD-CONFIG: 2c86f778-e09b-4440-8b15-867914633a10 X-G-Data-MailSecurity-for-Exchange-Guid: B8F2F20E-E369-4064-AC56-310A4E511044 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 14, 2018 at 07:54:37AM +0200, Florian Westphal wrote: > 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) ] ? Hm, yes. Maybe something between /0 and /32 makes more sense.