Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sched_ext: Use kvfree_rcu() to release per-cpu ksyncs object

The free_kick_syncs_rcu() rcu-callback only invoke kvfree() to
release per-cpu ksyncs object, this can use kvfree_rcu() replace
call_rcu() to release per-cpu ksyncs object in the free_kick_syncs().

Signed-off-by: Zqiang <qiang.zhang@linux.dev>
Signed-off-by: Tejun Heo <tj@kernel.org>

authored by

Zqiang and committed by
Tejun Heo
348d3c58 1dcb98bb

+1 -8
+1 -8
kernel/sched/ext.c
··· 4161 4161 } 4162 4162 } 4163 4163 4164 - static void free_kick_syncs_rcu(struct rcu_head *rcu) 4165 - { 4166 - struct scx_kick_syncs *ksyncs = container_of(rcu, struct scx_kick_syncs, rcu); 4167 - 4168 - kvfree(ksyncs); 4169 - } 4170 - 4171 4164 static void free_kick_syncs(void) 4172 4165 { 4173 4166 int cpu; ··· 4171 4178 4172 4179 to_free = rcu_replace_pointer(*ksyncs, NULL, true); 4173 4180 if (to_free) 4174 - call_rcu(&to_free->rcu, free_kick_syncs_rcu); 4181 + kvfree_rcu(to_free, rcu); 4175 4182 } 4176 4183 } 4177 4184