* [PATCH 1/5] sched_ext: Remove deprecated SCX_OPS_HAS_CGROUP_WEIGHT flag
@ 2026-03-06 12:48 zhidao su
2026-03-06 14:01 ` Andrea Righi
0 siblings, 1 reply; 4+ messages in thread
From: zhidao su @ 2026-03-06 12:48 UTC (permalink / raw)
To: tj, sched-ext, linux-kernel
Cc: void, arighi, changwoo, linux-kselftest, Su Zhidao
From: Su Zhidao <suzhidao@xiaomi.com>
SCX_OPS_HAS_CGROUP_WEIGHT was deprecated in 6.15 with a comment
'will be removed on 6.18'. Now that we are at 6.18, remove it.
The flag was a no-op and only triggered a pr_warn() on use. Remove
the flag definition, the warning, and update scx_flatcg which was
the last in-tree user.
Signed-off-by: Su Zhidao <suzhidao@xiaomi.com>
---
kernel/sched/ext.c | 3 ---
kernel/sched/ext_internal.h | 8 +-------
tools/sched_ext/include/scx/enum_defs.autogen.h | 1 -
tools/sched_ext/scx_flatcg.bpf.c | 2 +-
4 files changed, 2 insertions(+), 12 deletions(-)
diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
index c4ccd685259f..56ff5874af94 100644
--- a/kernel/sched/ext.c
+++ b/kernel/sched/ext.c
@@ -5061,9 +5061,6 @@ static int validate_ops(struct scx_sched *sch, 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");
-
if (ops->cpu_acquire || ops->cpu_release)
pr_warn("ops->cpu_acquire/release() are deprecated, use sched_switch TP instead\n");
diff --git a/kernel/sched/ext_internal.h b/kernel/sched/ext_internal.h
index bd26811fea99..3c86c53e1975 100644
--- a/kernel/sched/ext_internal.h
+++ b/kernel/sched/ext_internal.h
@@ -174,19 +174,13 @@ enum scx_ops_flags {
*/
SCX_OPS_BUILTIN_IDLE_PER_NODE = 1LLU << 6,
- /*
- * CPU cgroup support flags
- */
- 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 |
SCX_OPS_ENQ_EXITING |
SCX_OPS_ENQ_MIGRATION_DISABLED |
SCX_OPS_ALLOW_QUEUED_WAKEUP |
SCX_OPS_SWITCH_PARTIAL |
- SCX_OPS_BUILTIN_IDLE_PER_NODE |
- SCX_OPS_HAS_CGROUP_WEIGHT,
+ SCX_OPS_BUILTIN_IDLE_PER_NODE,
/* high 8 bits are internal, don't include in SCX_OPS_ALL_FLAGS */
__SCX_OPS_INTERNAL_MASK = 0xffLLU << 56,
diff --git a/tools/sched_ext/include/scx/enum_defs.autogen.h b/tools/sched_ext/include/scx/enum_defs.autogen.h
index dcc945304760..80c885f781ba 100644
--- a/tools/sched_ext/include/scx/enum_defs.autogen.h
+++ b/tools/sched_ext/include/scx/enum_defs.autogen.h
@@ -91,7 +91,6 @@
#define HAVE_SCX_OPS_SWITCH_PARTIAL
#define HAVE_SCX_OPS_ENQ_MIGRATION_DISABLED
#define HAVE_SCX_OPS_ALLOW_QUEUED_WAKEUP
-#define HAVE_SCX_OPS_HAS_CGROUP_WEIGHT
#define HAVE_SCX_OPS_ALL_FLAGS
#define HAVE_SCX_OPSS_NONE
#define HAVE_SCX_OPSS_QUEUEING
diff --git a/tools/sched_ext/scx_flatcg.bpf.c b/tools/sched_ext/scx_flatcg.bpf.c
index 0e785cff0f24..a8a9234bb41e 100644
--- a/tools/sched_ext/scx_flatcg.bpf.c
+++ b/tools/sched_ext/scx_flatcg.bpf.c
@@ -960,5 +960,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");
--
2.43.0
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH 1/5] sched_ext: Remove deprecated SCX_OPS_HAS_CGROUP_WEIGHT flag
2026-03-06 12:48 [PATCH 1/5] sched_ext: Remove deprecated SCX_OPS_HAS_CGROUP_WEIGHT flag zhidao su
@ 2026-03-06 14:01 ` Andrea Righi
2026-03-06 14:06 ` zhidao su
0 siblings, 1 reply; 4+ messages in thread
From: Andrea Righi @ 2026-03-06 14:01 UTC (permalink / raw)
To: zhidao su
Cc: tj, sched-ext, linux-kernel, void, changwoo, linux-kselftest,
Su Zhidao
Hi,
On Fri, Mar 06, 2026 at 08:48:57PM +0800, zhidao su wrote:
> From: Su Zhidao <suzhidao@xiaomi.com>
>
> SCX_OPS_HAS_CGROUP_WEIGHT was deprecated in 6.15 with a comment
> 'will be removed on 6.18'. Now that we are at 6.18, remove it.
>
> The flag was a no-op and only triggered a pr_warn() on use. Remove
> the flag definition, the warning, and update scx_flatcg which was
> the last in-tree user.
>
> Signed-off-by: Su Zhidao <suzhidao@xiaomi.com>
Please, when sending multiple patches, group them together in the same
email thread with cover letter email, otherwise it's very unpractical to
apply and review them.
See Documentation/process/submitting-patches.rst.
Thanks,
-Andrea
> ---
> kernel/sched/ext.c | 3 ---
> kernel/sched/ext_internal.h | 8 +-------
> tools/sched_ext/include/scx/enum_defs.autogen.h | 1 -
> tools/sched_ext/scx_flatcg.bpf.c | 2 +-
> 4 files changed, 2 insertions(+), 12 deletions(-)
>
> diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
> index c4ccd685259f..56ff5874af94 100644
> --- a/kernel/sched/ext.c
> +++ b/kernel/sched/ext.c
> @@ -5061,9 +5061,6 @@ static int validate_ops(struct scx_sched *sch, 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");
> -
> if (ops->cpu_acquire || ops->cpu_release)
> pr_warn("ops->cpu_acquire/release() are deprecated, use sched_switch TP instead\n");
>
> diff --git a/kernel/sched/ext_internal.h b/kernel/sched/ext_internal.h
> index bd26811fea99..3c86c53e1975 100644
> --- a/kernel/sched/ext_internal.h
> +++ b/kernel/sched/ext_internal.h
> @@ -174,19 +174,13 @@ enum scx_ops_flags {
> */
> SCX_OPS_BUILTIN_IDLE_PER_NODE = 1LLU << 6,
>
> - /*
> - * CPU cgroup support flags
> - */
> - 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 |
> SCX_OPS_ENQ_EXITING |
> SCX_OPS_ENQ_MIGRATION_DISABLED |
> SCX_OPS_ALLOW_QUEUED_WAKEUP |
> SCX_OPS_SWITCH_PARTIAL |
> - SCX_OPS_BUILTIN_IDLE_PER_NODE |
> - SCX_OPS_HAS_CGROUP_WEIGHT,
> + SCX_OPS_BUILTIN_IDLE_PER_NODE,
>
> /* high 8 bits are internal, don't include in SCX_OPS_ALL_FLAGS */
> __SCX_OPS_INTERNAL_MASK = 0xffLLU << 56,
> diff --git a/tools/sched_ext/include/scx/enum_defs.autogen.h b/tools/sched_ext/include/scx/enum_defs.autogen.h
> index dcc945304760..80c885f781ba 100644
> --- a/tools/sched_ext/include/scx/enum_defs.autogen.h
> +++ b/tools/sched_ext/include/scx/enum_defs.autogen.h
> @@ -91,7 +91,6 @@
> #define HAVE_SCX_OPS_SWITCH_PARTIAL
> #define HAVE_SCX_OPS_ENQ_MIGRATION_DISABLED
> #define HAVE_SCX_OPS_ALLOW_QUEUED_WAKEUP
> -#define HAVE_SCX_OPS_HAS_CGROUP_WEIGHT
> #define HAVE_SCX_OPS_ALL_FLAGS
> #define HAVE_SCX_OPSS_NONE
> #define HAVE_SCX_OPSS_QUEUEING
> diff --git a/tools/sched_ext/scx_flatcg.bpf.c b/tools/sched_ext/scx_flatcg.bpf.c
> index 0e785cff0f24..a8a9234bb41e 100644
> --- a/tools/sched_ext/scx_flatcg.bpf.c
> +++ b/tools/sched_ext/scx_flatcg.bpf.c
> @@ -960,5 +960,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");
> --
> 2.43.0
>
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH 1/5] sched_ext: Remove deprecated SCX_OPS_HAS_CGROUP_WEIGHT flag
2026-03-06 14:01 ` Andrea Righi
@ 2026-03-06 14:06 ` zhidao su
0 siblings, 0 replies; 4+ messages in thread
From: zhidao su @ 2026-03-06 14:06 UTC (permalink / raw)
To: arighi
Cc: tj, sched-ext, linux-kernel, void, changwoo, linux-kselftest,
Su Zhidao
From: Su Zhidao <suzhidao@xiaomi.com>
On Fri, Mar 06, 2026 at 03:01:49PM +0100, Andrea Righi wrote:
> Please, when sending multiple patches, group them together in the same
> email thread with cover letter email, otherwise it's very unpractical to
> apply and review them.
>
> See Documentation/process/submitting-patches.rst.
Thanks for the feedback. Apologies for the inconvenience.
I resent the series as a proper patch thread with cover letter:
Subject: [PATCH 0/5] sched_ext: bypass state machine cleanup and selftest
Message-ID: <20260306140325.2710927-1-suzhidao@xiaomi.com>
Sorry for the noise.
--
Su Zhidao
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 0/5] sched_ext: bypass state machine cleanup and selftest
@ 2026-03-06 14:03 zhidao su
2026-03-06 14:03 ` [PATCH 1/5] sched_ext: Remove deprecated SCX_OPS_HAS_CGROUP_WEIGHT flag zhidao su
0 siblings, 1 reply; 4+ messages in thread
From: zhidao su @ 2026-03-06 14:03 UTC (permalink / raw)
To: tj, sched-ext, linux-kernel
Cc: void, arighi, changwoo, linux-kselftest, Su Zhidao
From: Su Zhidao <suzhidao@xiaomi.com>
This series does a small cleanup pass on the sched_ext bypass code path
and adds a selftest for the bypass mechanism.
Patch 1 removes SCX_OPS_HAS_CGROUP_WEIGHT, which was marked deprecated
in 6.15 with a "will be removed on 6.18" comment. We are now past that
point.
Patches 2-3 improve the bypass code in ext.c: add inline comments
explaining the bypass depth counter semantics and the dequeue/enqueue
re-queue loop, and replace rcu_dereference_all() with the more precise
rcu_dereference_bh() in scx_bypass_lb_timerfn() which runs in softirq
context.
Patch 4 adds a selftest that verifies forward progress under bypass
mode: worker processes are spawned while the scheduler is active, then
bpf_link__destroy() is called (triggering bypass), and the test confirms
all workers complete successfully.
Patch 5 adds a comment to the scx_bypass_depth declaration noting its
planned migration into struct scx_sched.
Tested on 6.18.7 with CONFIG_SCHED_CLASS_EXT=y; all existing selftests
pass.
Su Zhidao (5):
sched_ext: Remove deprecated SCX_OPS_HAS_CGROUP_WEIGHT flag
sched_ext: Add comments to scx_bypass() for bypass depth semantics
sched_ext: Use rcu_dereference_bh() in scx_bypass_lb_timerfn()
sched_ext/selftests: Add bypass mode operational test
sched_ext: Document scx_bypass_depth migration path
kernel/sched/ext.c | 29 ++++-
kernel/sched/ext_internal.h | 8 +-
.../sched_ext/include/scx/enum_defs.autogen.h | 1 -
tools/sched_ext/scx_flatcg.bpf.c | 2 +-
tools/testing/selftests/sched_ext/Makefile | 1 +
.../testing/selftests/sched_ext/bypass.bpf.c | 32 ++++++
tools/testing/selftests/sched_ext/bypass.c | 105 ++++++++++++++++++
7 files changed, 165 insertions(+), 13 deletions(-)
create mode 100644 tools/testing/selftests/sched_ext/bypass.bpf.c
create mode 100644 tools/testing/selftests/sched_ext/bypass.c
--
2.43.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/5] sched_ext: Remove deprecated SCX_OPS_HAS_CGROUP_WEIGHT flag
2026-03-06 14:03 [PATCH 0/5] sched_ext: bypass state machine cleanup and selftest zhidao su
@ 2026-03-06 14:03 ` zhidao su
0 siblings, 0 replies; 4+ messages in thread
From: zhidao su @ 2026-03-06 14:03 UTC (permalink / raw)
To: tj, sched-ext, linux-kernel
Cc: void, arighi, changwoo, linux-kselftest, Su Zhidao
From: Su Zhidao <suzhidao@xiaomi.com>
SCX_OPS_HAS_CGROUP_WEIGHT was deprecated in 6.15 with a comment
'will be removed on 6.18'. Now that we are at 6.18, remove it.
The flag was a no-op and only triggered a pr_warn() on use. Remove
the flag definition, the warning, and update scx_flatcg which was
the last in-tree user.
Signed-off-by: Su Zhidao <suzhidao@xiaomi.com>
---
kernel/sched/ext.c | 3 ---
kernel/sched/ext_internal.h | 8 +-------
tools/sched_ext/include/scx/enum_defs.autogen.h | 1 -
tools/sched_ext/scx_flatcg.bpf.c | 2 +-
4 files changed, 2 insertions(+), 12 deletions(-)
diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
index c4ccd685259f..56ff5874af94 100644
--- a/kernel/sched/ext.c
+++ b/kernel/sched/ext.c
@@ -5061,9 +5061,6 @@ static int validate_ops(struct scx_sched *sch, 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");
-
if (ops->cpu_acquire || ops->cpu_release)
pr_warn("ops->cpu_acquire/release() are deprecated, use sched_switch TP instead\n");
diff --git a/kernel/sched/ext_internal.h b/kernel/sched/ext_internal.h
index bd26811fea99..3c86c53e1975 100644
--- a/kernel/sched/ext_internal.h
+++ b/kernel/sched/ext_internal.h
@@ -174,19 +174,13 @@ enum scx_ops_flags {
*/
SCX_OPS_BUILTIN_IDLE_PER_NODE = 1LLU << 6,
- /*
- * CPU cgroup support flags
- */
- 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 |
SCX_OPS_ENQ_EXITING |
SCX_OPS_ENQ_MIGRATION_DISABLED |
SCX_OPS_ALLOW_QUEUED_WAKEUP |
SCX_OPS_SWITCH_PARTIAL |
- SCX_OPS_BUILTIN_IDLE_PER_NODE |
- SCX_OPS_HAS_CGROUP_WEIGHT,
+ SCX_OPS_BUILTIN_IDLE_PER_NODE,
/* high 8 bits are internal, don't include in SCX_OPS_ALL_FLAGS */
__SCX_OPS_INTERNAL_MASK = 0xffLLU << 56,
diff --git a/tools/sched_ext/include/scx/enum_defs.autogen.h b/tools/sched_ext/include/scx/enum_defs.autogen.h
index dcc945304760..80c885f781ba 100644
--- a/tools/sched_ext/include/scx/enum_defs.autogen.h
+++ b/tools/sched_ext/include/scx/enum_defs.autogen.h
@@ -91,7 +91,6 @@
#define HAVE_SCX_OPS_SWITCH_PARTIAL
#define HAVE_SCX_OPS_ENQ_MIGRATION_DISABLED
#define HAVE_SCX_OPS_ALLOW_QUEUED_WAKEUP
-#define HAVE_SCX_OPS_HAS_CGROUP_WEIGHT
#define HAVE_SCX_OPS_ALL_FLAGS
#define HAVE_SCX_OPSS_NONE
#define HAVE_SCX_OPSS_QUEUEING
diff --git a/tools/sched_ext/scx_flatcg.bpf.c b/tools/sched_ext/scx_flatcg.bpf.c
index 0e785cff0f24..a8a9234bb41e 100644
--- a/tools/sched_ext/scx_flatcg.bpf.c
+++ b/tools/sched_ext/scx_flatcg.bpf.c
@@ -960,5 +960,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");
--
2.43.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-03-06 14:06 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-06 12:48 [PATCH 1/5] sched_ext: Remove deprecated SCX_OPS_HAS_CGROUP_WEIGHT flag zhidao su
2026-03-06 14:01 ` Andrea Righi
2026-03-06 14:06 ` zhidao su
-- strict thread matches above, loose matches on Subject: below --
2026-03-06 14:03 [PATCH 0/5] sched_ext: bypass state machine cleanup and selftest zhidao su
2026-03-06 14:03 ` [PATCH 1/5] sched_ext: Remove deprecated SCX_OPS_HAS_CGROUP_WEIGHT flag zhidao su
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.