lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aLi13oYFKMOe1GuD@gpd4>
Date: Wed, 3 Sep 2025 23:40:46 +0200
From: Andrea Righi <arighi@...dia.com>
To: Tejun Heo <tj@...nel.org>
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

On Wed, Sep 03, 2025 at 09:44:32AM -1000, Tejun Heo wrote:
> 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?

Makes sense, I'll adjust this in the next version.

Actually, this patch doesn't necessarily need to be part of this series,
I'll probably submit it separately.

Thanks,
-Andrea

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ