Skip to content

Commit 1bd6a2f

Browse files
committed
scx_layered: 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 c9bf149 commit 1bd6a2f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1341,7 +1341,6 @@ static bool try_preempt_cpu(s32 cand, struct task_struct *p, struct task_ctx *ta
13411341
struct layer *layer, u64 flags)
13421342
{
13431343
struct cpu_ctx *cpuc, *cand_cpuc, *sib_cpuc = NULL;
1344-
struct rq *rq;
13451344
struct task_struct *curr;
13461345
const struct cpumask *idle_cpumask;
13471346
bool cand_idle;
@@ -1368,10 +1367,9 @@ static bool try_preempt_cpu(s32 cand, struct task_struct *p, struct task_ctx *ta
13681367
if (scx_bpf_dsq_nr_queued(SCX_DSQ_LOCAL_ON | cand))
13691368
return false;
13701369

1371-
rq = scx_bpf_cpu_rq(cand);
1372-
if (!rq)
1370+
curr = __COMPAT_scx_bpf_cpu_curr(cand);
1371+
if (!curr)
13731372
return false;
1374-
curr = rq->curr;
13751373

13761374
if (ext_sched_class_addr && idle_sched_class_addr &&
13771375
((u64)curr->sched_class != ext_sched_class_addr) &&

0 commit comments

Comments
 (0)