[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241120064716.3361211-2-ranxiaokai627@163.com>
Date: Wed, 20 Nov 2024 06:47:13 +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 1/4] sched/topology: convert call_rcu(free_ctx) to kfree_rcu()
From: Ran Xiaokai <ran.xiaokai@....com.cn>
The rcu callback free_asym_cap_entry() simply calls kfree().
It's better to directly call kfree_rcu().
Signed-off-by: Ran Xiaokai <ran.xiaokai@....com.cn>
---
kernel/sched/topology.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c
index 9748a4c8d668..60ff3ba1d6ff 100644
--- a/kernel/sched/topology.c
+++ b/kernel/sched/topology.c
@@ -1382,12 +1382,6 @@ asym_cpu_capacity_classify(const struct cpumask *sd_span,
}
-static void free_asym_cap_entry(struct rcu_head *head)
-{
- struct asym_cap_data *entry = container_of(head, struct asym_cap_data, rcu);
- kfree(entry);
-}
-
static inline void asym_cpu_capacity_update_data(int cpu)
{
unsigned long capacity = arch_scale_cpu_capacity(cpu);
@@ -1438,7 +1432,7 @@ static void asym_cpu_capacity_scan(void)
list_for_each_entry_safe(entry, next, &asym_cap_list, link) {
if (cpumask_empty(cpu_capacity_span(entry))) {
list_del_rcu(&entry->link);
- call_rcu(&entry->rcu, free_asym_cap_entry);
+ kfree_rcu(entry, rcu);
}
}
@@ -1449,7 +1443,7 @@ static void asym_cpu_capacity_scan(void)
if (list_is_singular(&asym_cap_list)) {
entry = list_first_entry(&asym_cap_list, typeof(*entry), link);
list_del_rcu(&entry->link);
- call_rcu(&entry->rcu, free_asym_cap_entry);
+ kfree_rcu(entry, rcu);
}
}
--
2.17.1
Powered by blists - more mailing lists