* [PATCH sched_ext/for-6.16] sched_ext: Remove cpu.weight / cpu.idle unimplemented warnings
@ 2025-04-07 23:20 Tejun Heo
2025-04-08 1:23 ` Changwoo Min
` (2 more replies)
0 siblings, 3 replies; 11+ messages in thread
From: Tejun Heo @ 2025-04-07 23:20 UTC (permalink / raw)
To: David Vernet, Andrea Righi, Changwoo Min; +Cc: linux-kernel
sched_ext generates warnings when cpu.weight / cpu.idle are set to
non-default values if the BPF scheduler doesn't implement weight support.
These warnings don't provide much value while adding constant annoyance. A
BPF scheduler may not implement any particular behavior and there's nothing
particularly special about missing cgroup weight support. Drop the warnings.
Signed-off-by: Tejun Heo <tj@kernel.org>
---
kernel/sched/ext.c | 40 +---------------------------------------
1 file changed, 1 insertion(+), 39 deletions(-)
--- a/kernel/sched/ext.c
+++ b/kernel/sched/ext.c
@@ -3896,34 +3896,6 @@ bool scx_can_stop_tick(struct rq *rq)
DEFINE_STATIC_PERCPU_RWSEM(scx_cgroup_rwsem);
static bool scx_cgroup_enabled;
-static bool cgroup_warned_missing_weight;
-static bool cgroup_warned_missing_idle;
-
-static void scx_cgroup_warn_missing_weight(struct task_group *tg)
-{
- if (scx_enable_state() == SCX_DISABLED || cgroup_warned_missing_weight)
- return;
-
- if ((scx_ops.flags & SCX_OPS_HAS_CGROUP_WEIGHT) || !tg->css.parent)
- return;
-
- pr_warn("sched_ext: \"%s\" does not implement cgroup cpu.weight\n",
- scx_ops.name);
- cgroup_warned_missing_weight = true;
-}
-
-static void scx_cgroup_warn_missing_idle(struct task_group *tg)
-{
- if (!scx_cgroup_enabled || cgroup_warned_missing_idle)
- return;
-
- if (!tg->idle)
- return;
-
- pr_warn("sched_ext: \"%s\" does not implement cgroup cpu.idle\n",
- scx_ops.name);
- cgroup_warned_missing_idle = true;
-}
int scx_tg_online(struct task_group *tg)
{
@@ -3933,8 +3905,6 @@ int scx_tg_online(struct task_group *tg)
percpu_down_read(&scx_cgroup_rwsem);
- scx_cgroup_warn_missing_weight(tg);
-
if (scx_cgroup_enabled) {
if (SCX_HAS_OP(cgroup_init)) {
struct scx_cgroup_init_args args =
@@ -4072,9 +4042,7 @@ void scx_group_set_weight(struct task_gr
void scx_group_set_idle(struct task_group *tg, bool idle)
{
- percpu_down_read(&scx_cgroup_rwsem);
- scx_cgroup_warn_missing_idle(tg);
- percpu_up_read(&scx_cgroup_rwsem);
+ /* TODO: Implement ops->cgroup_set_idle() */
}
static void scx_cgroup_lock(void)
@@ -4268,9 +4236,6 @@ static int scx_cgroup_init(void)
percpu_rwsem_assert_held(&scx_cgroup_rwsem);
- cgroup_warned_missing_weight = false;
- cgroup_warned_missing_idle = false;
-
/*
* scx_tg_on/offline() are excluded through scx_cgroup_rwsem. If we walk
* cgroups and init, all online cgroups are initialized.
@@ -4280,9 +4245,6 @@ static int scx_cgroup_init(void)
struct task_group *tg = css_tg(css);
struct scx_cgroup_init_args args = { .weight = tg->scx_weight };
- scx_cgroup_warn_missing_weight(tg);
- scx_cgroup_warn_missing_idle(tg);
-
if ((tg->scx_flags &
(SCX_TG_ONLINE | SCX_TG_INITED)) != SCX_TG_ONLINE)
continue;
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH sched_ext/for-6.16] sched_ext: Remove cpu.weight / cpu.idle unimplemented warnings
2025-04-07 23:20 [PATCH sched_ext/for-6.16] sched_ext: Remove cpu.weight / cpu.idle unimplemented warnings Tejun Heo
@ 2025-04-08 1:23 ` Changwoo Min
2025-04-08 7:58 ` Andrea Righi
2025-04-08 17:55 ` [PATCH sched_ext/for-6.16] sched_ext: Remove cpu.weight / cpu.idle unimplemented warnings Tejun Heo
2 siblings, 0 replies; 11+ messages in thread
From: Changwoo Min @ 2025-04-08 1:23 UTC (permalink / raw)
To: Tejun Heo, David Vernet, Andrea Righi; +Cc: linux-kernel
Hi Tejun,
This makes sense to me.
Acked-by: Changwoo Min <changwoo@igalia.com>
Regards,
Changwoo Min
On 4/8/25 08:20, Tejun Heo wrote:
> sched_ext generates warnings when cpu.weight / cpu.idle are set to
> non-default values if the BPF scheduler doesn't implement weight support.
> These warnings don't provide much value while adding constant annoyance. A
> BPF scheduler may not implement any particular behavior and there's nothing
> particularly special about missing cgroup weight support. Drop the warnings.
>
> Signed-off-by: Tejun Heo <tj@kernel.org>
> ---
> kernel/sched/ext.c | 40 +---------------------------------------
> 1 file changed, 1 insertion(+), 39 deletions(-)
>
> --- a/kernel/sched/ext.c
> +++ b/kernel/sched/ext.c
> @@ -3896,34 +3896,6 @@ bool scx_can_stop_tick(struct rq *rq)
>
> DEFINE_STATIC_PERCPU_RWSEM(scx_cgroup_rwsem);
> static bool scx_cgroup_enabled;
> -static bool cgroup_warned_missing_weight;
> -static bool cgroup_warned_missing_idle;
> -
> -static void scx_cgroup_warn_missing_weight(struct task_group *tg)
> -{
> - if (scx_enable_state() == SCX_DISABLED || cgroup_warned_missing_weight)
> - return;
> -
> - if ((scx_ops.flags & SCX_OPS_HAS_CGROUP_WEIGHT) || !tg->css.parent)
> - return;
> -
> - pr_warn("sched_ext: \"%s\" does not implement cgroup cpu.weight\n",
> - scx_ops.name);
> - cgroup_warned_missing_weight = true;
> -}
> -
> -static void scx_cgroup_warn_missing_idle(struct task_group *tg)
> -{
> - if (!scx_cgroup_enabled || cgroup_warned_missing_idle)
> - return;
> -
> - if (!tg->idle)
> - return;
> -
> - pr_warn("sched_ext: \"%s\" does not implement cgroup cpu.idle\n",
> - scx_ops.name);
> - cgroup_warned_missing_idle = true;
> -}
>
> int scx_tg_online(struct task_group *tg)
> {
> @@ -3933,8 +3905,6 @@ int scx_tg_online(struct task_group *tg)
>
> percpu_down_read(&scx_cgroup_rwsem);
>
> - scx_cgroup_warn_missing_weight(tg);
> -
> if (scx_cgroup_enabled) {
> if (SCX_HAS_OP(cgroup_init)) {
> struct scx_cgroup_init_args args =
> @@ -4072,9 +4042,7 @@ void scx_group_set_weight(struct task_gr
>
> void scx_group_set_idle(struct task_group *tg, bool idle)
> {
> - percpu_down_read(&scx_cgroup_rwsem);
> - scx_cgroup_warn_missing_idle(tg);
> - percpu_up_read(&scx_cgroup_rwsem);
> + /* TODO: Implement ops->cgroup_set_idle() */
> }
>
> static void scx_cgroup_lock(void)
> @@ -4268,9 +4236,6 @@ static int scx_cgroup_init(void)
>
> percpu_rwsem_assert_held(&scx_cgroup_rwsem);
>
> - cgroup_warned_missing_weight = false;
> - cgroup_warned_missing_idle = false;
> -
> /*
> * scx_tg_on/offline() are excluded through scx_cgroup_rwsem. If we walk
> * cgroups and init, all online cgroups are initialized.
> @@ -4280,9 +4245,6 @@ static int scx_cgroup_init(void)
> struct task_group *tg = css_tg(css);
> struct scx_cgroup_init_args args = { .weight = tg->scx_weight };
>
> - scx_cgroup_warn_missing_weight(tg);
> - scx_cgroup_warn_missing_idle(tg);
> -
> if ((tg->scx_flags &
> (SCX_TG_ONLINE | SCX_TG_INITED)) != SCX_TG_ONLINE)
> continue;
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH sched_ext/for-6.16] sched_ext: Remove cpu.weight / cpu.idle unimplemented warnings
2025-04-07 23:20 [PATCH sched_ext/for-6.16] sched_ext: Remove cpu.weight / cpu.idle unimplemented warnings Tejun Heo
2025-04-08 1:23 ` Changwoo Min
@ 2025-04-08 7:58 ` Andrea Righi
2025-04-08 18:12 ` [PATCH sched_ext/for-6.15-fixes] sched_ext: Mark SCX_OPS_HAS_CGROUP_WEIGHT for deprecation Tejun Heo
2025-04-08 17:55 ` [PATCH sched_ext/for-6.16] sched_ext: Remove cpu.weight / cpu.idle unimplemented warnings Tejun Heo
2 siblings, 1 reply; 11+ messages in thread
From: Andrea Righi @ 2025-04-08 7:58 UTC (permalink / raw)
To: Tejun Heo; +Cc: David Vernet, Changwoo Min, linux-kernel
Hi Tejun,
On Mon, Apr 07, 2025 at 01:20:04PM -1000, Tejun Heo wrote:
> sched_ext generates warnings when cpu.weight / cpu.idle are set to
> non-default values if the BPF scheduler doesn't implement weight support.
> These warnings don't provide much value while adding constant annoyance. A
> BPF scheduler may not implement any particular behavior and there's nothing
> particularly special about missing cgroup weight support. Drop the warnings.
Thanks for dropping these warnings. :)
Acked-by: Andrea Righi <arighi@nvidia.com>
Should we also deprecate SCX_OPS_HAS_CGROUP_WEIGHT (not necessarily in this
patch)? It's basically unused at this point.
Thanks,
-Andrea
>
> Signed-off-by: Tejun Heo <tj@kernel.org>
> ---
> kernel/sched/ext.c | 40 +---------------------------------------
> 1 file changed, 1 insertion(+), 39 deletions(-)
>
> --- a/kernel/sched/ext.c
> +++ b/kernel/sched/ext.c
> @@ -3896,34 +3896,6 @@ bool scx_can_stop_tick(struct rq *rq)
>
> DEFINE_STATIC_PERCPU_RWSEM(scx_cgroup_rwsem);
> static bool scx_cgroup_enabled;
> -static bool cgroup_warned_missing_weight;
> -static bool cgroup_warned_missing_idle;
> -
> -static void scx_cgroup_warn_missing_weight(struct task_group *tg)
> -{
> - if (scx_enable_state() == SCX_DISABLED || cgroup_warned_missing_weight)
> - return;
> -
> - if ((scx_ops.flags & SCX_OPS_HAS_CGROUP_WEIGHT) || !tg->css.parent)
> - return;
> -
> - pr_warn("sched_ext: \"%s\" does not implement cgroup cpu.weight\n",
> - scx_ops.name);
> - cgroup_warned_missing_weight = true;
> -}
> -
> -static void scx_cgroup_warn_missing_idle(struct task_group *tg)
> -{
> - if (!scx_cgroup_enabled || cgroup_warned_missing_idle)
> - return;
> -
> - if (!tg->idle)
> - return;
> -
> - pr_warn("sched_ext: \"%s\" does not implement cgroup cpu.idle\n",
> - scx_ops.name);
> - cgroup_warned_missing_idle = true;
> -}
>
> int scx_tg_online(struct task_group *tg)
> {
> @@ -3933,8 +3905,6 @@ int scx_tg_online(struct task_group *tg)
>
> percpu_down_read(&scx_cgroup_rwsem);
>
> - scx_cgroup_warn_missing_weight(tg);
> -
> if (scx_cgroup_enabled) {
> if (SCX_HAS_OP(cgroup_init)) {
> struct scx_cgroup_init_args args =
> @@ -4072,9 +4042,7 @@ void scx_group_set_weight(struct task_gr
>
> void scx_group_set_idle(struct task_group *tg, bool idle)
> {
> - percpu_down_read(&scx_cgroup_rwsem);
> - scx_cgroup_warn_missing_idle(tg);
> - percpu_up_read(&scx_cgroup_rwsem);
> + /* TODO: Implement ops->cgroup_set_idle() */
> }
>
> static void scx_cgroup_lock(void)
> @@ -4268,9 +4236,6 @@ static int scx_cgroup_init(void)
>
> percpu_rwsem_assert_held(&scx_cgroup_rwsem);
>
> - cgroup_warned_missing_weight = false;
> - cgroup_warned_missing_idle = false;
> -
> /*
> * scx_tg_on/offline() are excluded through scx_cgroup_rwsem. If we walk
> * cgroups and init, all online cgroups are initialized.
> @@ -4280,9 +4245,6 @@ static int scx_cgroup_init(void)
> struct task_group *tg = css_tg(css);
> struct scx_cgroup_init_args args = { .weight = tg->scx_weight };
>
> - scx_cgroup_warn_missing_weight(tg);
> - scx_cgroup_warn_missing_idle(tg);
> -
> if ((tg->scx_flags &
> (SCX_TG_ONLINE | SCX_TG_INITED)) != SCX_TG_ONLINE)
> continue;
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH sched_ext/for-6.16] sched_ext: Remove cpu.weight / cpu.idle unimplemented warnings
2025-04-07 23:20 [PATCH sched_ext/for-6.16] sched_ext: Remove cpu.weight / cpu.idle unimplemented warnings Tejun Heo
2025-04-08 1:23 ` Changwoo Min
2025-04-08 7:58 ` Andrea Righi
@ 2025-04-08 17:55 ` Tejun Heo
2025-04-08 18:01 ` Tejun Heo
2 siblings, 1 reply; 11+ messages in thread
From: Tejun Heo @ 2025-04-08 17:55 UTC (permalink / raw)
To: David Vernet, Andrea Righi, Changwoo Min; +Cc: linux-kernel
On Mon, Apr 07, 2025 at 01:20:04PM -1000, Tejun Heo wrote:
> sched_ext generates warnings when cpu.weight / cpu.idle are set to
> non-default values if the BPF scheduler doesn't implement weight support.
> These warnings don't provide much value while adding constant annoyance. A
> BPF scheduler may not implement any particular behavior and there's nothing
> particularly special about missing cgroup weight support. Drop the warnings.
>
> Signed-off-by: Tejun Heo <tj@kernel.org>
Applied to sched_ext/for-6.16.
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH sched_ext/for-6.16] sched_ext: Remove cpu.weight / cpu.idle unimplemented warnings
2025-04-08 17:55 ` [PATCH sched_ext/for-6.16] sched_ext: Remove cpu.weight / cpu.idle unimplemented warnings Tejun Heo
@ 2025-04-08 18:01 ` Tejun Heo
0 siblings, 0 replies; 11+ messages in thread
From: Tejun Heo @ 2025-04-08 18:01 UTC (permalink / raw)
To: David Vernet, Andrea Righi, Changwoo Min; +Cc: linux-kernel
On Tue, Apr 08, 2025 at 07:55:31AM -1000, Tejun Heo wrote:
> On Mon, Apr 07, 2025 at 01:20:04PM -1000, Tejun Heo wrote:
> > sched_ext generates warnings when cpu.weight / cpu.idle are set to
> > non-default values if the BPF scheduler doesn't implement weight support.
> > These warnings don't provide much value while adding constant annoyance. A
> > BPF scheduler may not implement any particular behavior and there's nothing
> > particularly special about missing cgroup weight support. Drop the warnings.
> >
> > Signed-off-by: Tejun Heo <tj@kernel.org>
>
> Applied to sched_ext/for-6.16.
Strike that. Applied to for-6.15-fixes instead. Better to get rid of it
sooner than later.
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH sched_ext/for-6.15-fixes] sched_ext: Mark SCX_OPS_HAS_CGROUP_WEIGHT for deprecation
2025-04-08 7:58 ` Andrea Righi
@ 2025-04-08 18:12 ` Tejun Heo
2025-04-08 18:28 ` Andrea Righi
2025-04-08 18:31 ` [PATCH v2 " Tejun Heo
0 siblings, 2 replies; 11+ messages in thread
From: Tejun Heo @ 2025-04-08 18:12 UTC (permalink / raw)
To: Andrea Righi; +Cc: David Vernet, Changwoo Min, linux-kernel
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.
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;
}
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH sched_ext/for-6.15-fixes] sched_ext: Mark SCX_OPS_HAS_CGROUP_WEIGHT for deprecation
2025-04-08 18:12 ` [PATCH sched_ext/for-6.15-fixes] sched_ext: Mark SCX_OPS_HAS_CGROUP_WEIGHT for deprecation Tejun Heo
@ 2025-04-08 18:28 ` Andrea Righi
2025-04-08 18:29 ` Tejun Heo
2025-04-08 18:31 ` [PATCH v2 " Tejun Heo
1 sibling, 1 reply; 11+ messages in thread
From: Andrea Righi @ 2025-04-08 18:28 UTC (permalink / raw)
To: Tejun Heo; +Cc: David Vernet, Changwoo Min, linux-kernel
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;
> }
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH sched_ext/for-6.15-fixes] sched_ext: Mark SCX_OPS_HAS_CGROUP_WEIGHT for deprecation
2025-04-08 18:28 ` Andrea Righi
@ 2025-04-08 18:29 ` Tejun Heo
0 siblings, 0 replies; 11+ messages in thread
From: Tejun Heo @ 2025-04-08 18:29 UTC (permalink / raw)
To: Andrea Righi; +Cc: David Vernet, Changwoo Min, linux-kernel
On Tue, Apr 08, 2025 at 08:28:18PM +0200, Andrea Righi wrote:
> 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.
Oh, sorry about that. Lemme send v2.
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v2 sched_ext/for-6.15-fixes] sched_ext: Mark SCX_OPS_HAS_CGROUP_WEIGHT for deprecation
2025-04-08 18:12 ` [PATCH sched_ext/for-6.15-fixes] sched_ext: Mark SCX_OPS_HAS_CGROUP_WEIGHT for deprecation Tejun Heo
2025-04-08 18:28 ` Andrea Righi
@ 2025-04-08 18:31 ` Tejun Heo
2025-04-08 18:41 ` Andrea Righi
2025-04-08 18:54 ` Tejun Heo
1 sibling, 2 replies; 11+ messages in thread
From: Tejun Heo @ 2025-04-08 18:31 UTC (permalink / raw)
To: Andrea Righi; +Cc: David Vernet, Changwoo Min, linux-kernel
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.
v2: Actually include the scx_flatcg update.
Signed-off-by: Tejun Heo <tj@kernel.org>
Suggested-by: Andrea Righi <arighi@nvidia.com>
---
kernel/sched/ext.c | 5 ++++-
tools/sched_ext/scx_flatcg.bpf.c | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
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;
}
diff --git a/tools/sched_ext/scx_flatcg.bpf.c b/tools/sched_ext/scx_flatcg.bpf.c
index 2c720e3ecad5..fdc7170639e6 100644
--- a/tools/sched_ext/scx_flatcg.bpf.c
+++ b/tools/sched_ext/scx_flatcg.bpf.c
@@ -950,5 +950,5 @@ SCX_OPS_DEFINE(flatcg_ops,
.cgroup_move = (void *)fcg_cgroup_move,
.init = (void *)fcg_init,
.exit = (void *)fcg_exit,
- .flags = SCX_OPS_HAS_CGROUP_WEIGHT | SCX_OPS_ENQ_EXITING,
+ .flags = SCX_OPS_ENQ_EXITING,
.name = "flatcg");
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v2 sched_ext/for-6.15-fixes] sched_ext: Mark SCX_OPS_HAS_CGROUP_WEIGHT for deprecation
2025-04-08 18:31 ` [PATCH v2 " Tejun Heo
@ 2025-04-08 18:41 ` Andrea Righi
2025-04-08 18:54 ` Tejun Heo
1 sibling, 0 replies; 11+ messages in thread
From: Andrea Righi @ 2025-04-08 18:41 UTC (permalink / raw)
To: Tejun Heo; +Cc: David Vernet, Changwoo Min, linux-kernel
On Tue, Apr 08, 2025 at 08:31:12AM -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.
>
> v2: Actually include the scx_flatcg update.
>
> Signed-off-by: Tejun Heo <tj@kernel.org>
> Suggested-by: Andrea Righi <arighi@nvidia.com>
Looks good, thanks!
Reviewed-by: Andrea Righi <arighi@nvidia.com>
-Andrea
> ---
> kernel/sched/ext.c | 5 ++++-
> tools/sched_ext/scx_flatcg.bpf.c | 2 +-
> 2 files changed, 5 insertions(+), 2 deletions(-)
>
> 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;
> }
>
> diff --git a/tools/sched_ext/scx_flatcg.bpf.c b/tools/sched_ext/scx_flatcg.bpf.c
> index 2c720e3ecad5..fdc7170639e6 100644
> --- a/tools/sched_ext/scx_flatcg.bpf.c
> +++ b/tools/sched_ext/scx_flatcg.bpf.c
> @@ -950,5 +950,5 @@ SCX_OPS_DEFINE(flatcg_ops,
> .cgroup_move = (void *)fcg_cgroup_move,
> .init = (void *)fcg_init,
> .exit = (void *)fcg_exit,
> - .flags = SCX_OPS_HAS_CGROUP_WEIGHT | SCX_OPS_ENQ_EXITING,
> + .flags = SCX_OPS_ENQ_EXITING,
> .name = "flatcg");
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 sched_ext/for-6.15-fixes] sched_ext: Mark SCX_OPS_HAS_CGROUP_WEIGHT for deprecation
2025-04-08 18:31 ` [PATCH v2 " Tejun Heo
2025-04-08 18:41 ` Andrea Righi
@ 2025-04-08 18:54 ` Tejun Heo
1 sibling, 0 replies; 11+ messages in thread
From: Tejun Heo @ 2025-04-08 18:54 UTC (permalink / raw)
To: Andrea Righi; +Cc: David Vernet, Changwoo Min, linux-kernel
On Tue, Apr 08, 2025 at 08:31:12AM -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.
>
> v2: Actually include the scx_flatcg update.
>
> Signed-off-by: Tejun Heo <tj@kernel.org>
> Suggested-by: Andrea Righi <arighi@nvidia.com>
Applied to sched_ext/for-6.15-fixes. Thanks.
--
tejun
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2025-04-08 18:54 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-07 23:20 [PATCH sched_ext/for-6.16] sched_ext: Remove cpu.weight / cpu.idle unimplemented warnings Tejun Heo
2025-04-08 1:23 ` Changwoo Min
2025-04-08 7:58 ` Andrea Righi
2025-04-08 18:12 ` [PATCH sched_ext/for-6.15-fixes] sched_ext: Mark SCX_OPS_HAS_CGROUP_WEIGHT for deprecation Tejun Heo
2025-04-08 18:28 ` Andrea Righi
2025-04-08 18:29 ` Tejun Heo
2025-04-08 18:31 ` [PATCH v2 " Tejun Heo
2025-04-08 18:41 ` Andrea Righi
2025-04-08 18:54 ` Tejun Heo
2025-04-08 17:55 ` [PATCH sched_ext/for-6.16] sched_ext: Remove cpu.weight / cpu.idle unimplemented warnings Tejun Heo
2025-04-08 18:01 ` Tejun Heo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox