From: Andrea Righi <arighi@nvidia.com>
To: Tejun Heo <tj@kernel.org>
Cc: void@manifault.com, changwoo@igalia.com,
linux-kernel@vger.kernel.org, sched-ext@lists.linux.dev
Subject: Re: [PATCH 7/7] sched_ext: Misc updates around scx_sched instance pointer
Date: Tue, 23 Sep 2025 10:36:53 +0200 [thread overview]
Message-ID: <aNJcJTOhl77pdkb_@gpd4> (raw)
In-Reply-To: <20250922161436.358949-8-tj@kernel.org>
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@kernel.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
next prev parent reply other threads:[~2025-09-23 8:37 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-22 16:14 [PATCHSET sched_ext/scx-misc-a] sched_ext: Add @sch parameter in preparation for multi-sched support Tejun Heo
2025-09-22 16:14 ` [PATCH 1/7] sched_ext: Separate out scx_kick_cpu() and add @sch to it Tejun Heo
2025-09-22 16:14 ` [PATCH 2/7] sched_ext: Add the @sch parameter to __bstr_format() Tejun Heo
2025-09-22 16:14 ` [PATCH 3/7] sched_ext: Add the @sch parameter to ext_idle helpers Tejun Heo
2025-09-22 16:14 ` [PATCH 4/7] sched_ext: Drop kf_cpu_valid() Tejun Heo
2025-09-22 16:14 ` [PATCH 5/7] sched_ext: Add the @sch parameter to scx_dsq_insert_preamble/commit() Tejun Heo
2025-09-22 16:14 ` [PATCH 6/7] sched_ext: Drop scx_kf_exit() and scx_kf_error() Tejun Heo
2025-09-22 16:14 ` [PATCH 7/7] sched_ext: Misc updates around scx_sched instance pointer Tejun Heo
2025-09-23 8:36 ` Andrea Righi [this message]
2025-09-23 17:19 ` [PATCH v2 " Tejun Heo
2025-09-23 9:12 ` [PATCHSET sched_ext/scx-misc-a] sched_ext: Add @sch parameter in preparation for multi-sched support Andrea Righi
2025-09-23 19:13 ` Tejun Heo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aNJcJTOhl77pdkb_@gpd4 \
--to=arighi@nvidia.com \
--cc=changwoo@igalia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sched-ext@lists.linux.dev \
--cc=tj@kernel.org \
--cc=void@manifault.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.