Skip to content

Commit 348d3c5

Browse files
Zqianghtejun
authored andcommitted
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 <[email protected]> Signed-off-by: Tejun Heo <[email protected]>
1 parent 1dcb98b commit 348d3c5

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

kernel/sched/ext.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4161,13 +4161,6 @@ static const char *scx_exit_reason(enum scx_exit_kind kind)
41614161
}
41624162
}
41634163

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-
41714164
static void free_kick_syncs(void)
41724165
{
41734166
int cpu;
@@ -4178,7 +4171,7 @@ static void free_kick_syncs(void)
41784171

41794172
to_free = rcu_replace_pointer(*ksyncs, NULL, true);
41804173
if (to_free)
4181-
call_rcu(&to_free->rcu, free_kick_syncs_rcu);
4174+
kvfree_rcu(to_free, rcu);
41824175
}
41834176
}
41844177

0 commit comments

Comments
 (0)