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] [day] [month] [year] [list]
Message-ID: <Z-uJ0m_bs4VXoDqQ@gpd3>
Date: Tue, 1 Apr 2025 08:38:10 +0200
From: Andrea Righi <arighi@...dia.com>
To: Tejun Heo <tj@...nel.org>
Cc: David Vernet <void@...ifault.com>, Changwoo Min <changwoo@...lia.com>,
	Joel Fernandes <joelagnelf@...dia.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 6/6] sched_ext: idle: Deprecate scx_bpf_select_cpu_dfl()

On Mon, Mar 31, 2025 at 12:01:22PM -1000, Tejun Heo wrote:
> Hello,
> 
> On Fri, Mar 21, 2025 at 11:10:52PM +0100, Andrea Righi wrote:
> > With the introduction of scx_bpf_select_cpu_and(), we can deprecate
> > scx_bpf_select_cpu_dfl(), as it offers only a subset of features and
> > it's also more consistent with other idle-related APIs (returning a
> > negative value when no idle CPU is found).
> > 
> > Therefore, mark scx_bpf_select_cpu_dfl() as deprecated (printing a
> > warning when it's used), update all the scheduler examples and
> > kselftests to adopt the new API, and ensure backward (source and binary)
> > compatibility by providing the necessary macros and hooks.
> > 
> > Support for scx_bpf_select_cpu_dfl() can be maintained until v6.17.
> 
> Do we need to deprecate it?
> 
> ...
> > @@ -43,10 +39,13 @@ s32 BPF_STRUCT_OPS(select_cpu_dfl_nodispatch_select_cpu, struct task_struct *p,
> >  		return -ESRCH;
> >  	}
> >  
> > -	cpu = scx_bpf_select_cpu_dfl(p, prev_cpu, wake_flags,
> > -				     &tctx->force_local);
> > +	cpu = scx_bpf_select_cpu_and(p, prev_cpu, wake_flags, p->cpus_ptr, 0);
> > +	if (cpu >= 0) {
> > +		tctx->force_local = true;
> > +		return cpu;
> > +	}
> >  
> > -	return cpu;
> > +	return prev_cpu;
> >  }
> 
> scx_bpf_select_cpu_dfl() is simpler for simple cases. I don't see a pressing
> need to convert everybody to _and().

Yeah, I don't have strong opinions on this, I included this patch mostly to
show that we can get rid of a kfunc if we want, but we don't really have to
and it's probably less work to just keep it. I'll drop this patch in the
next version.

Thanks for the review!

-Andrea

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ