From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: nicolas.prochazka@gmail.com Received: from krantz.zx2c4.com (localhost [127.0.0.1]) by krantz.zx2c4.com (ZX2C4 Mail Server) with ESMTP id d61fca68 for ; Wed, 14 Jun 2017 07:37:24 +0000 (UTC) Received: from mail-oi0-f48.google.com (mail-oi0-f48.google.com [209.85.218.48]) by krantz.zx2c4.com (ZX2C4 Mail Server) with ESMTP id f4184d83 for ; Wed, 14 Jun 2017 07:37:24 +0000 (UTC) Received: by mail-oi0-f48.google.com with SMTP id e11so43549568oia.2 for ; Wed, 14 Jun 2017 00:52:15 -0700 (PDT) MIME-Version: 1.0 Sender: nicolas.prochazka@gmail.com In-Reply-To: References: From: nicolas prochazka Date: Wed, 14 Jun 2017 09:52:13 +0200 Message-ID: Subject: Re: multiple wireguard interface and kworker ressources To: "Jason A. Donenfeld" Content-Type: text/plain; charset="UTF-8" Cc: WireGuard mailing list List-Id: Development discussion of WireGuard List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , hello, after create of wg interface, kworker thread does not return to a normal state in my case, kernel thread continues to consume a lot of cpu . I must delete wireguard interface to kworker decrease. Nicolas 2017-06-13 23:47 GMT+02:00 Jason A. Donenfeld : > Hi Nicolas, > > It looks to me like some resources are indeed expended in adding those > interfaces. Not that much that would be problematic -- are you seeing > a problematic case? -- but still a non-trivial amount. > > I tracked it down to WireGuard's instantiation of xt_hashlimit, which > does some ugly vmalloc, and it's call into the power state > notification system, which uses a naive O(n) algorithm for insertion. > I might have a way of amortizing on module insertion, which would > speed things up. But I wonder -- what is the practical detriment of > spending a few extra cycles on `ip link add`? What's your use case > where this would actually be a problem? > > Thanks, > Jason