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: <aRGkQe7H2VNfVqwA@gpd4>
Date: Mon, 10 Nov 2025 09:37:21 +0100
From: Andrea Righi <arighi@...dia.com>
To: Tejun Heo <tj@...nel.org>
Cc: David Vernet <void@...ifault.com>, Changwoo Min <changwoo@...lia.com>,
	Dan Schatzberg <schatzberg.dan@...il.com>,
	Emil Tsalapatis <etsal@...a.com>, sched-ext@...ts.linux.dev,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 12/13] sched_ext: Factor out scx_dsq_list_node cursor
 initialization into INIT_DSQ_LIST_CURSOR

On Sun, Nov 09, 2025 at 08:31:11AM -1000, Tejun Heo wrote:
> Factor out scx_dsq_list_node cursor initialization into INIT_DSQ_LIST_CURSOR
> macro in preparation for additional users.
> 
> Cc: Dan Schatzberg <schatzberg.dan@...il.com>
> Cc: Emil Tsalapatis <etsal@...a.com>
> Signed-off-by: Tejun Heo <tj@...nel.org>

Acked-by: Andrea Righi <arighi@...dia.com>

Thanks,
-Andrea

> ---
>  include/linux/sched/ext.h | 7 +++++++
>  kernel/sched/ext.c        | 5 ++---
>  2 files changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/include/linux/sched/ext.h b/include/linux/sched/ext.h
> index 12561a3fcee4..280828b13608 100644
> --- a/include/linux/sched/ext.h
> +++ b/include/linux/sched/ext.h
> @@ -149,6 +149,13 @@ struct scx_dsq_list_node {
>  	u32			priv;		/* can be used by iter cursor */
>  };
>  
> +#define INIT_DSQ_LIST_CURSOR(__node, __flags, __priv)				\
> +	(struct scx_dsq_list_node) {						\
> +		.node = LIST_HEAD_INIT((__node).node),				\
> +		.flags = SCX_DSQ_LNODE_ITER_CURSOR | (__flags),			\
> +		.priv = (__priv),						\
> +	}
> +
>  /*
>   * The following is embedded in task_struct and contains all fields necessary
>   * for a task to be scheduled by SCX.
> diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
> index bd66178e5927..4b2cc6cc8cb2 100644
> --- a/kernel/sched/ext.c
> +++ b/kernel/sched/ext.c
> @@ -6252,9 +6252,8 @@ __bpf_kfunc int bpf_iter_scx_dsq_new(struct bpf_iter_scx_dsq *it, u64 dsq_id,
>  	if (!kit->dsq)
>  		return -ENOENT;
>  
> -	INIT_LIST_HEAD(&kit->cursor.node);
> -	kit->cursor.flags = SCX_DSQ_LNODE_ITER_CURSOR | flags;
> -	kit->cursor.priv = READ_ONCE(kit->dsq->seq);
> +	kit->cursor = INIT_DSQ_LIST_CURSOR(kit->cursor, flags,
> +					   READ_ONCE(kit->dsq->seq));
>  
>  	return 0;
>  }
> -- 
> 2.51.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ