Skip to content

Commit c9bf149

Browse files
committed
scx_lavd: Use scx_bpf_cpu_curr()
Use the new scx_bpf_cpu_curr() introduced in v6.18 as a safer way to access rq->curr instead of the deprecated scx_bpf_cpu_rq(). Signed-off-by: Christian Loehle <[email protected]>
1 parent 9c9f282 commit c9bf149

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

scheds/rust/scx_lavd/src/bpf/preempt.bpf.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,9 @@ static void ask_cpu_yield_after(struct cpu_ctx *victim_cpuc, u64 new_slice)
196196
* set the victim task's time slice to zero so the victim task yields
197197
* the CPU in the next scheduling point.
198198
*/
199-
struct rq *victim_rq;
200-
struct task_struct *victim_p;
199+
struct task_struct *victim_p = __COMPAT_scx_bpf_cpu_curr(victim_cpuc->cpu_id);
201200

202-
victim_rq = scx_bpf_cpu_rq(victim_cpuc->cpu_id);
203-
if (victim_rq && (victim_p = victim_rq->curr)) {
201+
if (victim_p) {
204202
/*
205203
* Finding a victim is racy, but we do not coordinate. Thus,
206204
* two different CPUs can choose the same victim CPU. We do not

0 commit comments

Comments
 (0)