public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ran Xiaokai <ranxiaokai627@163.com>
To: juri.lelli@redhat.com, vincent.guittot@linaro.org,
	mingo@redhat.com, peterz@infradead.org, pshelar@ovn.org,
	davem@davemloft.net
Cc: linux-kernel@vger.kernel.org, ran.xiaokai@zte.com.cn,
	linux-perf-users@vger.kernel.org, netdev@vger.kernel.org,
	dev@openvswitch.org
Subject: [PATCH 3/4] net: openvswitch: convert call_rcu(dp_meter_instance_free_rcu) to kvfree_rcu()
Date: Wed, 20 Nov 2024 06:47:15 +0000	[thread overview]
Message-ID: <20241120064716.3361211-4-ranxiaokai627@163.com> (raw)
In-Reply-To: <20241120064716.3361211-1-ranxiaokai627@163.com>

From: Ran Xiaokai <ran.xiaokai@zte.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@zte.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



  parent reply	other threads:[~2024-11-20  6:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-20  6:47 [PATCH 0/4] Convert some simple call_rcu() to kfree_rcu()/kvfree_rcu() Ran Xiaokai
2024-11-20  6:47 ` [PATCH 1/4] sched/topology: convert call_rcu(free_ctx) to kfree_rcu() Ran Xiaokai
2024-11-20  6:47 ` [PATCH 2/4] perf/core: " Ran Xiaokai
2024-11-20  9:12   ` Peter Zijlstra
2024-11-20  9:16     ` Peter Zijlstra
2024-11-20  6:47 ` Ran Xiaokai [this message]
2024-11-20  6:47 ` [PATCH 4/4] net: sysfs: convert call_rcu() to kvfree_rcu() Ran Xiaokai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241120064716.3361211-4-ranxiaokai627@163.com \
    --to=ranxiaokai627@163.com \
    --cc=davem@davemloft.net \
    --cc=dev@openvswitch.org \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=pshelar@ovn.org \
    --cc=ran.xiaokai@zte.com.cn \
    --cc=vincent.guittot@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox