lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241120064716.3361211-4-ranxiaokai627@163.com>
Date: Wed, 20 Nov 2024 06:47:15 +0000
From: Ran Xiaokai <ranxiaokai627@....com>
To: juri.lelli@...hat.com,
	vincent.guittot@...aro.org,
	mingo@...hat.com,
	peterz@...radead.org,
	pshelar@....org,
	davem@...emloft.net
Cc: linux-kernel@...r.kernel.org,
	ran.xiaokai@....com.cn,
	linux-perf-users@...r.kernel.org,
	netdev@...r.kernel.org,
	dev@...nvswitch.org
Subject: [PATCH 3/4] net: openvswitch: convert call_rcu(dp_meter_instance_free_rcu) to kvfree_rcu()

From: Ran Xiaokai <ran.xiaokai@....com.cn>

The rcu callback dp_meter_instance_free_rcu() simply calls kvfree().
It's better to directly call kvfree_rcu().

Signed-off-by: Ran Xiaokai <ran.xiaokai@....com.cn>
---
 net/openvswitch/meter.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/net/openvswitch/meter.c b/net/openvswitch/meter.c
index cc08e0403909..d99efb9ce1a0 100644
--- a/net/openvswitch/meter.c
+++ b/net/openvswitch/meter.c
@@ -83,14 +83,6 @@ static void dp_meter_instance_free(struct dp_meter_instance *ti)
 	kvfree(ti);
 }
 
-static void dp_meter_instance_free_rcu(struct rcu_head *rcu)
-{
-	struct dp_meter_instance *ti;
-
-	ti = container_of(rcu, struct dp_meter_instance, rcu);
-	kvfree(ti);
-}
-
 static int
 dp_meter_instance_realloc(struct dp_meter_table *tbl, u32 size)
 {
@@ -108,7 +100,7 @@ dp_meter_instance_realloc(struct dp_meter_table *tbl, u32 size)
 			new_ti->dp_meters[i] = ti->dp_meters[i];
 
 	rcu_assign_pointer(tbl->ti, new_ti);
-	call_rcu(&ti->rcu, dp_meter_instance_free_rcu);
+	kvfree_rcu(ti, rcu);
 
 	return 0;
 }
-- 
2.17.1



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ