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: <CABFh=a7x4rXergkASTr2T8c20Yu1E0+_5ZaPijLhzGEkM_Pmrw@mail.gmail.com>
Date: Mon, 10 Nov 2025 18:56:48 -0500
From: Emil Tsalapatis <linux-lists@...alapatis.com>
To: Tejun Heo <tj@...nel.org>
Cc: David Vernet <void@...ifault.com>, Andrea Righi <andrea.righi@...ux.dev>, 
	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, 
	Andrea Righi <arighi@...dia.com>
Subject: Re: [PATCH v2 12/14] sched_ext: Factor out scx_dsq_list_node cursor
 initialization into INIT_DSQ_LIST_CURSOR

On Mon, Nov 10, 2025 at 3:56 PM Tejun Heo <tj@...nel.org> 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>
> Acked-by: Andrea Righi <arighi@...dia.com>
> Signed-off-by: Tejun Heo <tj@...nel.org>
> ---

Reviewed-by: Emil Tsalapatis <emil@...alapatis.com>

>  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 4b501ad7a3fc..3f6bf2875431 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 d16525abf9e0..82f0d2202b99 100644
> --- a/kernel/sched/ext.c
> +++ b/kernel/sched/ext.c
> @@ -6249,9 +6249,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.2
>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ