[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z1k--b0f1RLARJ65@slm.duckdns.org>
Date: Tue, 10 Dec 2024 21:27:53 -1000
From: Tejun Heo <tj@...nel.org>
To: Changwoo Min <multics69@...il.com>
Cc: void@...ifault.com, mingo@...hat.com, peterz@...radead.org,
changwoo@...lia.com, kernel-dev@...lia.com,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 1/6] sched_ext: Relocate scx_enabled() related code
On Mon, Dec 09, 2024 at 03:15:26PM +0900, Changwoo Min wrote:
> scx_enabled() will be used in scx_rq_clock_update/stale() in the
> following patch, so relocate the scx_enabled() related code to the
> proper location.
>
> Signed-off-by: Changwoo Min <changwoo@...lia.com>
> ---
> kernel/sched/sched.h | 26 +++++++++++++-------------
> 1 file changed, 13 insertions(+), 13 deletions(-)
>
> diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
> index 76f5f53a645f..440ecedf871b 100644
> --- a/kernel/sched/sched.h
> +++ b/kernel/sched/sched.h
> @@ -1717,6 +1717,19 @@ struct rq_flags {
>
> extern struct balance_callback balance_push_callback;
>
> +#ifdef CONFIG_SCHED_CLASS_EXT
> +extern const struct sched_class ext_sched_class;
> +
> +DECLARE_STATIC_KEY_FALSE(__scx_ops_enabled); /* SCX BPF scheduler loaded */
> +DECLARE_STATIC_KEY_FALSE(__scx_switched_all); /* all fair class tasks on SCX */
> +
> +#define scx_enabled() static_branch_unlikely(&__scx_ops_enabled)
> +#define scx_switched_all() static_branch_unlikely(&__scx_switched_all)
> +#else /* !CONFIG_SCHED_CLASS_EXT */
> +#define scx_enabled() false
> +#define scx_switched_all() false
> +#endif /* !CONFIG_SCHED_CLASS_EXT */
I wonder whether a better place for the above is include/linux/sched/ext.
Thanks.
--
tejun
Powered by blists - more mailing lists