Re: [PATCH sched_ext/for-6.15-fixes] sched_ext: Mark SCX_OPS_HAS_CGROUP_WEIGHT for deprecation

Andrea Righi
2025-04-08T18:28:26Z

Hi Tejun,

On Tue, Apr 08, 2025 at 08:12:57AM -1000, Tejun Heo wrote:
> SCX_OPS_HAS_CGROUP_WEIGHT was only used to suppress the missing cgroup
> weight support warnings. Now that the warnings are removed, the flag doesn't
> do anything. Mark it for deprecation and remove its usage from scx_flatcg.

Is the removal from scx_flatcg meant to be part of this patch, or is it
intended as a follow-up? Other than that LGTM.

Thanks,
-Andrea

>
> Signed-off-by: Tejun Heo <tj@kernel.org>
> Suggested-by: Andrea Righi <arighi@nvidia.com>
> ---
> kernel/sched/ext.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
> index 21eaf081d336..fdbf249d1c68 100644
> --- a/kernel/sched/ext.c
> +++ b/kernel/sched/ext.c
> @@ -163,7 +163,7 @@ enum scx_ops_flags {
> /*
> * CPU cgroup support flags
> */
> - SCX_OPS_HAS_CGROUP_WEIGHT = 1LLU << 16, /* cpu.weight */
> + SCX_OPS_HAS_CGROUP_WEIGHT = 1LLU << 16, /* DEPRECATED, will be removed on 6.18 */
>
> SCX_OPS_ALL_FLAGS = SCX_OPS_KEEP_BUILTIN_IDLE |
> SCX_OPS_ENQ_LAST |
> @@ -5213,6 +5213,9 @@ static int validate_ops(const struct sched_ext_ops *ops)
> return -EINVAL;
> }
>
> + if (ops->flags & SCX_OPS_HAS_CGROUP_WEIGHT)
> + pr_warn("SCX_OPS_HAS_CGROUP_WEIGHT is deprecated and a noop\n");
> +
> return 0;
> }
>