Received: by 2002:ab2:68c1:0:b0:1fd:9a81:d0e4 with SMTP id e1csp408176lqp; Sun, 9 Jun 2024 01:28:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU0eKUB65K33LAqKRnOMRmKszppU8LZw7/BlrfUPoYBHpb/fS/6+nLrkxtUHzBrQOIoinmDuq6I+sMkd69jzIGjqqZQvxKNn14KrYugOg== X-Google-Smtp-Source: AGHT+IHIuHc99O2cnrOlW0bUkUgX4AS+FufMYiVwDVL+EeBxASQbsaPSIdIwXtzRtlGRqnV7Y7+8 X-Received: by 2002:a05:6870:a688:b0:250:8060:8cd0 with SMTP id 586e51a60fabf-25464573d18mr7074678fac.34.1717921694568; Sun, 09 Jun 2024 01:28:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717921694; cv=pass; d=google.com; s=arc-20160816; b=zloVSQeO5+yE1qFlju3vrZ2NciTlBUPcc1rspUxE+CbXIQPo6aLogjp9rQVlpsGZf5 eusoE6O1cERZLvK5rNfJ7B+s7V/BsmM7HMrpBUasvvOztB5/9+Ln0ITV2EFv5VNwkpD3 r5HlPk3XJV7CCUFC/vbsSOU5R7eARaGNWxC0kLzFD8yNwkG3vcNZJ7Jwh3I5m0N4WAvu 7WW5hnFH8wvXCtXSv5woki2Jc6MMnDa3eIClPlD8EWhY8mEgYgC7XahWhXRREdvh6M6F 8Z+11UmVygnSh3byo3jf3S0aGeDuBdpQuP3kzQG9uMgWQPCfXRrgdAEVzgIhZbF8uayC D/7A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=REYx9XJxXex1wT0g8DdBknTJa5z8s+++8BsQM1tAkdE=; fh=9kNU2FxmrLsfLBR3zdhgIkq2b2cw+pBbSC7zuAFzDas=; b=mFbuBwhJU0ikhWijE7Syb/3luwV/wfl6Z8qe5s2n3aICZeXxnA/AElru0kqUw2gUSV HvDbqiQwaPpbOMCgZasD788+hGt9hplFk8m3K2QTL9f3MhGb3Z+R1rgKis/leG4gWbaj u2AOAeqvKu9weyitzzQG0o2aJtYWXKufOtR9x2+4lQ4D4gUgvn0JFrhDCu6US7vePlZg j6EmaZyssMTvTQ76x0UFJpfT/VuOWlYLOsJAcpm697eswgamTcPjLp8ePUc5CNZhQ9VH 3m3amBVUrDxWCKqcZQjkyA+6rbUEKGgzFcXExIZYb6ydMJBhbbMG+OHP0kJnWWLQhHH+ sE5Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@inria.fr header.s=dc header.b=c3jg9XiA; arc=pass (i=1 spf=pass spfdomain=inria.fr dkim=pass dkdomain=inria.fr dmarc=pass fromdomain=inria.fr); spf=pass (google.com: domain of linux-nfs+bounces-3620-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3620-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=inria.fr Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d2e1a72fcca58-7041ff8fbbesi2708136b3a.315.2024.06.09.01.28.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jun 2024 01:28:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs+bounces-3620-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@inria.fr header.s=dc header.b=c3jg9XiA; arc=pass (i=1 spf=pass spfdomain=inria.fr dkim=pass dkdomain=inria.fr dmarc=pass fromdomain=inria.fr); spf=pass (google.com: domain of linux-nfs+bounces-3620-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3620-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=inria.fr Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 9FD22B21861 for ; Sun, 9 Jun 2024 08:28:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 489D51CAB3; Sun, 9 Jun 2024 08:28:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=inria.fr header.i=@inria.fr header.b="c3jg9XiA" X-Original-To: linux-nfs@vger.kernel.org Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9AB351CA89; Sun, 9 Jun 2024 08:27:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.134.164.83 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717921680; cv=none; b=ZQPgzDDLcl/QSGo1gkIIy7VgMsEwPZA8zCyPrtXP8d8XXrYlQGU52loGAQ0YxcC1EyiSGobzedoZQIySNxC0PqYUjGZSC1rtprAhDXMfLSDsWxYpOiVw0IS/rMoBYRaXhDRne9RRYJyQOJdImTUKTtULF1unqy2Oy5ClxFcJuGI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717921680; c=relaxed/simple; bh=cl9fmVF+HqNubeETqLioP3KnvOsLThBpD2QkFmQe7ZM=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=cHqexTzfwS2VZtl2wgHwW7NnVCV5Gnx/7CQTtZRsC5mgR0Ol7JnCxa8A4u8T7CyPwakz4HnjxjPGmTmUbnRQ0AaANnLYziwdOYhlimmw+lh8MRBNh+wfJWswxtFtJey2YKpruKScdh8GjN0zpOZ5TyKP/iYvfERvpv8/36nDwrc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=inria.fr; spf=pass smtp.mailfrom=inria.fr; dkim=pass (1024-bit key) header.d=inria.fr header.i=@inria.fr header.b=c3jg9XiA; arc=none smtp.client-ip=192.134.164.83 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=inria.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=inria.fr DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=REYx9XJxXex1wT0g8DdBknTJa5z8s+++8BsQM1tAkdE=; b=c3jg9XiAgeKcNkg9Ypz1MXA57+I6z9Upi3oqzG67AIxQoc2Tb/l9+twd o1xqjWHj9bZB/XffVTZ6y3Q5wlIBrpiRIuaxP20ZifTf9z4PP9a6/uHrQ jbNAr8EHCg32T8reqfZHBfM1Bu9ssqsOLmK26M8DXHwpWqbgwQfkqJwz8 I=; Authentication-Results: mail2-relais-roc.national.inria.fr; dkim=none (message not signed) header.i=none; spf=SoftFail smtp.mailfrom=Julia.Lawall@inria.fr; dmarc=fail (p=none dis=none) d=inria.fr X-IronPort-AV: E=Sophos;i="6.08,225,1712613600"; d="scan'208";a="169696895" Received: from i80.paris.inria.fr (HELO i80.paris.inria.fr.) ([128.93.90.48]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jun 2024 10:27:48 +0200 From: Julia Lawall To: linux-block@vger.kernel.org Cc: 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, "Paul E . McKenney" , Vlastimil Babka Subject: [PATCH 00/14] replace call_rcu by kfree_rcu for simple kmem_cache_free callback Date: Sun, 9 Jun 2024 10:27:12 +0200 Message-Id: <20240609082726.32742-1-Julia.Lawall@inria.fr> X-Mailer: git-send-email 2.20.1 Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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. // @r@ expression e; local idexpression e2; identifier cb,f; position p; @@ ( call_rcu(...,e2) | call_rcu(&e->f,cb@p) ) @r1@ type T; identifier x,r.cb; @@ cb(...) { ( kmem_cache_free(...); | T x = ...; kmem_cache_free(...,x); | T x; x = ...; kmem_cache_free(...,x); ) } @s depends on r1@ position p != r.p; identifier r.cb; @@ cb@p @script:ocaml@ cb << r.cb; p << s.p; @@ Printf.eprintf "Other use of %s at %s:%d\n" cb (List.hd p).file (List.hd p).line @depends on r1 && !s@ expression e; identifier r.cb,f; position r.p; @@ - call_rcu(&e->f,cb@p) + kfree_rcu(e,f) @r1a depends on !s@ type T; identifier x,r.cb; @@ - cb(...) { ( - kmem_cache_free(...); | - T x = ...; - kmem_cache_free(...,x); | - T x; - x = ...; - kmem_cache_free(...,x); ) - } // Signed-off-by: Julia Lawall Reviewed-by: Paul E. McKenney Reviewed-by: Vlastimil Babka --- arch/powerpc/kvm/book3s_mmu_hpte.c | 8 +------- block/blk-ioc.c | 9 +-------- drivers/net/wireguard/allowedips.c | 9 ++------- fs/ecryptfs/dentry.c | 8 +------- fs/nfsd/nfs4state.c | 9 +-------- fs/tracefs/inode.c | 10 +--------- kernel/time/posix-timers.c | 9 +-------- kernel/workqueue.c | 8 +------- net/bridge/br_fdb.c | 9 +-------- net/can/gw.c | 13 +++---------- net/ipv4/fib_trie.c | 8 +------- net/ipv4/inetpeer.c | 9 ++------- net/ipv6/ip6_fib.c | 9 +-------- net/ipv6/xfrm6_tunnel.c | 8 +------- net/kcm/kcmsock.c | 10 +--------- net/netfilter/nf_conncount.c | 10 +--------- net/netfilter/nf_conntrack_expect.c | 10 +--------- net/netfilter/xt_hashlimit.c | 9 +-------- 18 files changed, 22 insertions(+), 143 deletions(-)