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: <aNJcJTOhl77pdkb_@gpd4>
Date: Tue, 23 Sep 2025 10:36:53 +0200
From: Andrea Righi <arighi@...dia.com>
To: Tejun Heo <tj@...nel.org>
Cc: void@...ifault.com, changwoo@...lia.com, linux-kernel@...r.kernel.org,
	sched-ext@...ts.linux.dev
Subject: Re: [PATCH 7/7] sched_ext: Misc updates around scx_sched instance
 pointer

Hi Tejun,

On Mon, Sep 22, 2025 at 06:14:36AM -1000, Tejun Heo wrote:
> In preparation for multiple scheduler support:
> 
> - Add the @sch parameter to find_global_dsq() and refill_task_slice_dfl().
> 
> - Restructure scx_allow_ttwu_queue() and make it read scx_root into $sch.
> 
> - Make RCU protection in scx_dsq_move() and scx_bpf_dsq_move_to_local()
>   explicit.
> 
> Signed-off-by: Tejun Heo <tj@...nel.org>
> ---
>  kernel/sched/ext.c | 62 ++++++++++++++++++++++++++++++----------------
>  1 file changed, 40 insertions(+), 22 deletions(-)
> 
> diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
> index 0c99a55f199b..32306203fba5 100644
> --- a/kernel/sched/ext.c
> +++ b/kernel/sched/ext.c
...
> @@ -3572,9 +3571,22 @@ bool task_should_scx(int policy)
>  
>  bool scx_allow_ttwu_queue(const struct task_struct *p)
>  {
> -	return !scx_enabled() ||
> -		(scx_root->ops.flags & SCX_OPS_ALLOW_QUEUED_WAKEUP) ||
> -		p->sched_class != &ext_sched_class;
> +	struct scx_sched *sch;
> +
> +	if (!scx_enabled())
> +		return true;
> +
> +	sch = rcu_dereference_sched(scx_root);
> +	if (unlikely(!sch))
> +		return true;
> +
> +	if (scx_root->ops.flags & SCX_OPS_ALLOW_QUEUED_WAKEUP)

We should use sch->ops.flags here.

> +		return true;
> +
> +	if (unlikely(p->sched_class != &ext_sched_class))
> +		return true;
> +
> +	return false;
>  }

Thanks,
-Andrea

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ