* [PATCH 0/2] sched_ext code cleanups
@ 2024-09-26 2:15 Zhang Qiao
2024-09-26 2:15 ` [PATCH 1/2] sched/ext: Fix unmatch trailing comment of CONFIG_EXT_GROUP_SCHED Zhang Qiao
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Zhang Qiao @ 2024-09-26 2:15 UTC (permalink / raw)
To: Ingo Molnar, Peter Zijlstra, Juri Lelli, Vincent Guittot,
Dietmar Eggemann, Steven Rostedt, Ben Segall, Mel Gorman,
Valentin Schneider, Tejun Heo, David Vernet
Cc: linux-kernel, zhangqiao22
Zhang Qiao (2):
sched/ext: Fix unmatch trailing comment of CONFIG_EXT_GROUP_SCHED
sched/ext: Use tg_cgroup() to elieminate duplicate code
kernel/sched/ext.c | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
--
2.33.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] sched/ext: Fix unmatch trailing comment of CONFIG_EXT_GROUP_SCHED
2024-09-26 2:15 [PATCH 0/2] sched_ext code cleanups Zhang Qiao
@ 2024-09-26 2:15 ` Zhang Qiao
2024-09-26 2:15 ` [PATCH 2/2] sched/ext: Use tg_cgroup() to elieminate duplicate code Zhang Qiao
2024-09-27 20:08 ` [PATCH 0/2] sched_ext code cleanups Tejun Heo
2 siblings, 0 replies; 4+ messages in thread
From: Zhang Qiao @ 2024-09-26 2:15 UTC (permalink / raw)
To: Ingo Molnar, Peter Zijlstra, Juri Lelli, Vincent Guittot,
Dietmar Eggemann, Steven Rostedt, Ben Segall, Mel Gorman,
Valentin Schneider, Tejun Heo, David Vernet
Cc: linux-kernel, zhangqiao22
The #endif trailing comment of CONFIG_EXT_GROUP_SCHED is unmatched, so fix
it.
Signed-off-by: Zhang Qiao <zhangqiao22@huawei.com>
---
kernel/sched/ext.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
index 9ee5a9a261cc..66aaca9efa0c 100644
--- a/kernel/sched/ext.c
+++ b/kernel/sched/ext.c
@@ -588,7 +588,7 @@ struct sched_ext_ops {
* Update @tg's weight to @weight.
*/
void (*cgroup_set_weight)(struct cgroup *cgrp, u32 weight);
-#endif /* CONFIG_CGROUPS */
+#endif /* CONFIG_EXT_GROUP_SCHED */
/*
* All online ops must come before ops.cpu_online().
--
2.33.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 2/2] sched/ext: Use tg_cgroup() to elieminate duplicate code
2024-09-26 2:15 [PATCH 0/2] sched_ext code cleanups Zhang Qiao
2024-09-26 2:15 ` [PATCH 1/2] sched/ext: Fix unmatch trailing comment of CONFIG_EXT_GROUP_SCHED Zhang Qiao
@ 2024-09-26 2:15 ` Zhang Qiao
2024-09-27 20:08 ` [PATCH 0/2] sched_ext code cleanups Tejun Heo
2 siblings, 0 replies; 4+ messages in thread
From: Zhang Qiao @ 2024-09-26 2:15 UTC (permalink / raw)
To: Ingo Molnar, Peter Zijlstra, Juri Lelli, Vincent Guittot,
Dietmar Eggemann, Steven Rostedt, Ben Segall, Mel Gorman,
Valentin Schneider, Tejun Heo, David Vernet
Cc: linux-kernel, zhangqiao22
Use tg_cgroup() to eliminate duplicate code patterns
in scx_bpf_task_cgroup().
Signed-off-by: Zhang Qiao <zhangqiao22@huawei.com>
---
kernel/sched/ext.c | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
index 66aaca9efa0c..eabf8705e1e6 100644
--- a/kernel/sched/ext.c
+++ b/kernel/sched/ext.c
@@ -7054,15 +7054,8 @@ __bpf_kfunc struct cgroup *scx_bpf_task_cgroup(struct task_struct *p)
if (!scx_kf_allowed_on_arg_tasks(__SCX_KF_RQ_LOCKED, p))
goto out;
- /*
- * A task_group may either be a cgroup or an autogroup. In the latter
- * case, @tg->css.cgroup is %NULL. A task_group can't become the other
- * kind once created.
- */
- if (tg && tg->css.cgroup)
- cgrp = tg->css.cgroup;
- else
- cgrp = &cgrp_dfl_root.cgrp;
+ cgrp = tg_cgrp(tg);
+
out:
cgroup_get(cgrp);
return cgrp;
--
2.33.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 0/2] sched_ext code cleanups
2024-09-26 2:15 [PATCH 0/2] sched_ext code cleanups Zhang Qiao
2024-09-26 2:15 ` [PATCH 1/2] sched/ext: Fix unmatch trailing comment of CONFIG_EXT_GROUP_SCHED Zhang Qiao
2024-09-26 2:15 ` [PATCH 2/2] sched/ext: Use tg_cgroup() to elieminate duplicate code Zhang Qiao
@ 2024-09-27 20:08 ` Tejun Heo
2 siblings, 0 replies; 4+ messages in thread
From: Tejun Heo @ 2024-09-27 20:08 UTC (permalink / raw)
To: Zhang Qiao
Cc: Ingo Molnar, Peter Zijlstra, Juri Lelli, Vincent Guittot,
Dietmar Eggemann, Steven Rostedt, Ben Segall, Mel Gorman,
Valentin Schneider, David Vernet, linux-kernel
On Thu, Sep 26, 2024 at 10:15:03AM +0800, Zhang Qiao wrote:
> Zhang Qiao (2):
> sched/ext: Fix unmatch trailing comment of CONFIG_EXT_GROUP_SCHED
> sched/ext: Use tg_cgroup() to elieminate duplicate code
Applied to sched_ext/for-6.13.
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-09-27 20:08 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-26 2:15 [PATCH 0/2] sched_ext code cleanups Zhang Qiao
2024-09-26 2:15 ` [PATCH 1/2] sched/ext: Fix unmatch trailing comment of CONFIG_EXT_GROUP_SCHED Zhang Qiao
2024-09-26 2:15 ` [PATCH 2/2] sched/ext: Use tg_cgroup() to elieminate duplicate code Zhang Qiao
2024-09-27 20:08 ` [PATCH 0/2] sched_ext code cleanups Tejun Heo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®