From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.zx2c4.com (lists.zx2c4.com [165.227.139.114]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 59CA5C27C4F for ; Thu, 13 Jun 2024 11:59:20 +0000 (UTC) Received: by lists.zx2c4.com (ZX2C4 Mail Server) with ESMTP id 5d8ae94b; Thu, 13 Jun 2024 11:59:17 +0000 (UTC) Received: from dfw.source.kernel.org (dfw.source.kernel.org [2604:1380:4641:c500::1]) by lists.zx2c4.com (ZX2C4 Mail Server) with ESMTPS id 8865b14b (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Thu, 13 Jun 2024 11:59:14 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id AC00661A4D; Thu, 13 Jun 2024 11:59:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2FEAAC4AF4D; Thu, 13 Jun 2024 11:59:10 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="MeI8MH8G" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1718279946; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=2oQoeraeqQaQpCY62eMS55dJmmDU2cLnySqsO1DV0bg=; b=MeI8MH8G9GaVwTubn3zbemt8iMGjhWu2xlRT5g6xh1L4MS9g8vj3/b4L5Io4CIm+PbC/28 K4kTBBhke2rM7bNZ2dv8VC/fK7/9r4oKXzXHf3Yt4ENzPLvg7XFBUp90WP45io3c2/cs6Q JMbCSdFZKlgC96+RmMCLxV7PaJ3gRO0= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id ebdb63be (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 13 Jun 2024 11:59:05 +0000 (UTC) Date: Thu, 13 Jun 2024 13:58:59 +0200 From: "Jason A. Donenfeld" To: "Paul E. McKenney" Cc: Jakub Kicinski , Julia Lawall , linux-block@vger.kernel.org, kernel-janitors@vger.kernel.org, bridge@lists.linux.dev, linux-trace-kernel@vger.kernel.org, Mathieu Desnoyers , kvm@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, "Naveen N. Rao" , Christophe Leroy , Nicholas Piggin , netdev@vger.kernel.org, wireguard@lists.zx2c4.com, linux-kernel@vger.kernel.org, ecryptfs@vger.kernel.org, Neil Brown , Olga Kornievskaia , Dai Ngo , Tom Talpey , linux-nfs@vger.kernel.org, linux-can@vger.kernel.org, Lai Jiangshan , netfilter-devel@vger.kernel.org, coreteam@netfilter.org, Vlastimil Babka Subject: Re: [PATCH 00/14] replace call_rcu by kfree_rcu for simple kmem_cache_free callback Message-ID: References: <20240609082726.32742-1-Julia.Lawall@inria.fr> <20240612143305.451abf58@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-BeenThere: wireguard@lists.zx2c4.com X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: Development discussion of WireGuard List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: wireguard-bounces@lists.zx2c4.com Sender: "WireGuard" On Wed, Jun 12, 2024 at 03:37:55PM -0700, Paul E. McKenney wrote: > On Wed, Jun 12, 2024 at 02:33:05PM -0700, Jakub Kicinski wrote: > > On Sun, 9 Jun 2024 10:27:12 +0200 Julia Lawall wrote: > > > Since SLOB was removed, it is not necessary to use call_rcu > > > when the callback only performs kmem_cache_free. Use > > > kfree_rcu() directly. > > > > > > The changes were done using the following Coccinelle semantic patch. > > > This semantic patch is designed to ignore cases where the callback > > > function is used in another way. > > > > How does the discussion on: > > [PATCH] Revert "batman-adv: prefer kfree_rcu() over call_rcu() with free-only callbacks" > > https://lore.kernel.org/all/20240612133357.2596-1-linus.luessing@c0d3.blue/ > > reflect on this series? IIUC we should hold off.. > > We do need to hold off for the ones in kernel modules (such as 07/14) > where the kmem_cache is destroyed during module unload. > > OK, I might as well go through them... > > [PATCH 01/14] wireguard: allowedips: replace call_rcu by kfree_rcu for simple kmem_cache_free callback > Needs to wait, see wg_allowedips_slab_uninit(). Also, notably, this patch needs additionally: diff --git a/drivers/net/wireguard/allowedips.c b/drivers/net/wireguard/allowedips.c index e4e1638fce1b..c95f6937c3f1 100644 --- a/drivers/net/wireguard/allowedips.c +++ b/drivers/net/wireguard/allowedips.c @@ -377,7 +377,6 @@ int __init wg_allowedips_slab_init(void) void wg_allowedips_slab_uninit(void) { - rcu_barrier(); kmem_cache_destroy(node_cache); } Once kmem_cache_destroy has been fixed to be deferrable. I assume the other patches are similar -- an rcu_barrier() can be removed. So some manual meddling of these might be in order. Jason