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: <Z9VDjLzd8CA-Xf9N@gpd3>
Date: Sat, 15 Mar 2025 10:08:28 +0100
From: Andrea Righi <arighi@...dia.com>
To: Changwoo Min <changwoo@...lia.com>
Cc: Tejun Heo <tj@...nel.org>, David Vernet <void@...ifault.com>,
	bpf@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 6/8] sched_ext: idle: Introduce scx_bpf_select_cpu_and()

Hi Changwoo,

On Sat, Mar 15, 2025 at 10:35:03AM +0900, Changwoo Min wrote:
> Hi Andrea,
...
> > +/**
> > + * scx_bpf_select_cpu_and - Pick an idle CPU usable by task @p,
> > + *			    prioritizing those in @cpus_allowed
> > + * @p: task_struct to select a CPU for
> > + * @prev_cpu: CPU @p was on previously
> > + * @wake_flags: %SCX_WAKE_* flags
> > + * @cpus_allowed: cpumask of allowed CPUs
> > + * @flags: %SCX_PICK_IDLE* flags
> > + *
> > + * Can only be called from ops.select_cpu() if the built-in CPU selection is
> > + * enabled - ops.update_idle() is missing or %SCX_OPS_KEEP_BUILTIN_IDLE is set.
> > + * @p, @prev_cpu and @wake_flags match ops.select_cpu().
> 
> I think that scx_bpf_select_cpu_and () needs to be allowed to
> call from ops.enqueue(). That is because many scx schedulers have
> some logic similar to scx_bpf_select_cpu_dfl() to kick an idle
> CPU proactively.

That's a valid point, it can be a good opportunity to consolidate the logic
used in most schedulers, where the same "pick idle CPU" function is called
from both ops.select_cpu() and ops.enqueue() and have a unified core API
usable from both contexts.

I'll extend the scope of this kfunc to include ops.enqueue() in the next
version and run some tests with it.

Thanks!
-Andrea

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ