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: <Z93h5B4xdzRHpjGQ@gpd3>
Date: Fri, 21 Mar 2025 23:02:12 +0100
From: Andrea Righi <arighi@...dia.com>
To: changwoo <changwoo@...lia.com>
Cc: Tejun Heo <tj@...nel.org>, David Vernet <void@...ifault.com>,
	Joel Fernandes <joelagnelf@...dia.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/6] sched_ext: idle: Explicitly pass allowed cpumask to
 scx_select_cpu_dfl()

On Fri, Mar 21, 2025 at 07:15:37PM +0900, changwoo wrote:
> Hi Andrea,
> 
> On 3/20/25 16:36, Andrea Righi wrote:
> > Modify scx_select_cpu_dfl() to take the allowed cpumask as an explicit
> > argument, instead of implicitly using @p->cpus_ptr.
> > 
> > This prepares for future changes where arbitrary cpumasks may be passed
> > to the built-in idle CPU selection policy.
> > 
> > This is a pure refactoring with no functional changes.
> > 
> > Signed-off-by: Andrea Righi <arighi@...dia.com>
> > ---
> >   kernel/sched/ext.c      |  2 +-
> >   kernel/sched/ext_idle.c | 45 ++++++++++++++++++++++++++---------------
> >   kernel/sched/ext_idle.h |  3 ++-
> >   3 files changed, 32 insertions(+), 18 deletions(-)
> > 
> > diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
> > index 06561d6717c9a..f42352e8d889e 100644
> > --- a/kernel/sched/ext.c
> > +++ b/kernel/sched/ext.c
> > @@ -3395,7 +3395,7 @@ static int select_task_rq_scx(struct task_struct *p, int prev_cpu, int wake_flag
> >   	} else {
> >   		s32 cpu;
> >   
> > -		cpu = scx_select_cpu_dfl(p, prev_cpu, wake_flags, 0);
> > +		cpu = scx_select_cpu_dfl(p, prev_cpu, wake_flags, p->cpus_ptr, 0);
> >   		if (cpu >= 0) {
> >   			p->scx.slice = SCX_SLICE_DFL;
> >   			p->scx.ddsp_dsq_id = SCX_DSQ_LOCAL;
> > diff --git a/kernel/sched/ext_idle.c b/kernel/sched/ext_idle.c
> > index e1e020c27c07c..a90d85bce1ccb 100644
> > --- a/kernel/sched/ext_idle.c
> > +++ b/kernel/sched/ext_idle.c
> > @@ -397,11 +397,19 @@ void scx_idle_update_selcpu_topology(struct sched_ext_ops *ops)
> >   		static_branch_disable_cpuslocked(&scx_selcpu_topo_numa);
> >   }
> >   
> > +static inline bool task_allowed_all_cpus(const struct task_struct *p)
> > +{
> > +	return p->nr_cpus_allowed >= num_possible_cpus();
> > +}
> 
> This function will be renamed to task_affinity_all() in patch #3.
> Can we use the same name from the beginning?
> That will make the commits easier to read.

Right, I'll clean up also this patch in the next version, thanks!

-Andrea

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ