From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Jason@zx2c4.com Received: from krantz.zx2c4.com (localhost [127.0.0.1]) by krantz.zx2c4.com (ZX2C4 Mail Server) with ESMTP id fd5a9ea8 for ; Tue, 13 Jun 2017 21:32:36 +0000 (UTC) Received: from frisell.zx2c4.com (frisell.zx2c4.com [192.95.5.64]) by krantz.zx2c4.com (ZX2C4 Mail Server) with ESMTP id 591a4785 for ; Tue, 13 Jun 2017 21:32:36 +0000 (UTC) Received: by frisell.zx2c4.com (ZX2C4 Mail Server) with ESMTP id c771e7e2 for ; Tue, 13 Jun 2017 21:46:08 +0000 (UTC) Received: by frisell.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 43ba9774 (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128:NO) for ; Tue, 13 Jun 2017 21:46:08 +0000 (UTC) Received: by mail-oi0-f43.google.com with SMTP id e11so38153272oia.2 for ; Tue, 13 Jun 2017 14:47:22 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: From: "Jason A. Donenfeld" Date: Tue, 13 Jun 2017 23:47:20 +0200 Message-ID: Subject: Re: multiple wireguard interface and kworker ressources To: nicolas prochazka 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: , 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