[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aLiaoEvjBfBsp-tR@slm.duckdns.org>
Date: Wed, 3 Sep 2025 09:44:32 -1000
From: Tejun Heo <tj@...nel.org>
To: Andrea Righi <arighi@...dia.com>
Cc: Ingo Molnar <mingo@...hat.com>, Peter Zijlstra <peterz@...radead.org>,
Juri Lelli <juri.lelli@...hat.com>,
Vincent Guittot <vincent.guittot@...aro.org>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Steven Rostedt <rostedt@...dmis.org>,
Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>,
Valentin Schneider <vschneid@...hat.com>,
Joel Fernandes <joelagnelf@...dia.com>,
David Vernet <void@...ifault.com>,
Changwoo Min <changwoo@...lia.com>, Shuah Khan <shuah@...nel.org>,
sched-ext@...ts.linux.dev, bpf@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 01/16] sched_ext: Exit early on hotplug events during
attach
Hello,
On Wed, Sep 03, 2025 at 11:33:27AM +0200, Andrea Righi wrote:
> static int validate_ops(struct scx_sched *sch, const struct sched_ext_ops *ops)
> @@ -5627,11 +5630,15 @@ static int scx_enable(struct sched_ext_ops *ops, struct bpf_link *link)
> if (((void (**)(void))ops)[i])
> set_bit(i, sch->has_op);
>
> - check_hotplug_seq(sch, ops);
> - scx_idle_update_selcpu_topology(ops);
> + ret = check_hotplug_seq(sch, ops);
> + if (!ret)
> + scx_idle_update_selcpu_topology(ops);
>
> cpus_read_unlock();
>
> + if (ret)
> + goto err_disable;
The double testing is a bit jarring. Maybe just add cpus_read_unlock() in
the error block so that error return can take place right after
check_hotplug_seq()? Alternatively, create a new error jump target - e.g.
err_disable_unlock_cpus and share it between here and the init failure path?
Thanks.
--
tejun
Powered by blists - more mailing lists