[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aJebkj-neVJNKEJ4@slm.duckdns.org>
Date: Sat, 9 Aug 2025 09:03:46 -1000
From: Tejun Heo <tj@...nel.org>
To: Christian Loehle <christian.loehle@....com>
Cc: arighi@...dia.com, void@...ifault.com, linux-kernel@...r.kernel.org,
sched-ext@...ts.linux.dev, changwoo@...lia.com, hodgesd@...a.com,
mingo@...hat.com, peterz@...radead.org
Subject: Re: [PATCH v3 3/3] sched_ext: Guarantee rq lock on scx_bpf_cpu_rq()
Hello,
On Tue, Aug 05, 2025 at 12:10:36PM +0100, Christian Loehle wrote:
> @@ -7420,10 +7420,20 @@ __bpf_kfunc s32 scx_bpf_task_cpu(const struct task_struct *p)
> */
> __bpf_kfunc struct rq *scx_bpf_cpu_rq(s32 cpu)
> {
> + struct rq *rq;
> +
> if (!kf_cpu_valid(cpu, NULL))
> return NULL;
>
> - return cpu_rq(cpu);
> + preempt_disable();
> + rq = cpu_rq(cpu);
> + if (rq != scx_locked_rq()) {
> + scx_kf_error("Accessing not locked rq %d", cpu);
> + rq = NULL;
> + }
> + preempt_enable();
So, this will break the existing scheduler binaries immediately, which I
don't think is a good way to go about it. Can you add a pr_warn_once() to
print deprecation warning and add e.g. scx_bpf_locked_cpu_rq() instead?
Thanks.
--
tejun
Powered by blists - more mailing lists