Skip to content

Commit eb700fc

Browse files
committed
scx_tickless: 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 1bd6a2f commit eb700fc

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

scheds/rust/scx_tickless/src/bpf/main.bpf.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -413,13 +413,12 @@ static int sched_timerfn(void *map, int *key, struct bpf_timer *timer)
413413
* Check if we need to preempt the running tasks.
414414
*/
415415
bpf_for(cpu, 0, nr_cpu_ids) {
416-
struct task_struct *p;
416+
struct task_struct *p = __COMPAT_scx_bpf_cpu_curr(cpu);
417417

418418
/*
419419
* Ignore CPU if idle task is running.
420420
*/
421-
p = scx_bpf_cpu_rq(cpu)->curr;
422-
if (p->flags & PF_IDLE)
421+
if (!p || p->flags & PF_IDLE)
423422
continue;
424423

425424
/*

0 commit comments

Comments
 (0)