diff options
author | Tejun Heo <[email protected]> | 2024-09-04 10:24:59 -1000 |
---|---|---|
committer | Tejun Heo <[email protected]> | 2024-09-04 10:24:59 -1000 |
commit | 859dc4ec5a4321298d8978cb6eeb3e21a2eebab5 (patch) | |
tree | 9dcf0a9b1d0fa3fe438f180851f76f0184b12fa2 | |
parent | a8532fac7b5d27b8d62008a89593dccb6f9786ef (diff) |
sched: Expose css_tg()
A new BPF extensible sched_class will use css_tg() in the init and exit
paths to visit all task_groups by walking cgroups.
v4: __setscheduler_prio() is already exposed. Dropped from this patch.
v3: Dropped SCHED_CHANGE_BLOCK() as upstream is adding more generic cleanup
mechanism.
v2: Expose SCHED_CHANGE_BLOCK() too and update the description.
Signed-off-by: Tejun Heo <[email protected]>
Reviewed-by: David Vernet <[email protected]>
Acked-by: Josh Don <[email protected]>
Acked-by: Hao Luo <[email protected]>
Acked-by: Barret Rhoden <[email protected]>
-rw-r--r-- | kernel/sched/core.c | 5 | ||||
-rw-r--r-- | kernel/sched/sched.h | 5 |
2 files changed, 5 insertions, 5 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index df56301bfa97..b05705dd5e92 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -8942,11 +8942,6 @@ void sched_move_task(struct task_struct *tsk) } } -static inline struct task_group *css_tg(struct cgroup_subsys_state *css) -{ - return css ? container_of(css, struct task_group, css) : NULL; -} - static struct cgroup_subsys_state * cpu_cgroup_css_alloc(struct cgroup_subsys_state *parent_css) { diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 73ba0cfe4226..b052ce72cdcd 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -514,6 +514,11 @@ static inline int walk_tg_tree(tg_visitor down, tg_visitor up, void *data) return walk_tg_tree_from(&root_task_group, down, up, data); } +static inline struct task_group *css_tg(struct cgroup_subsys_state *css) +{ + return css ? container_of(css, struct task_group, css) : NULL; +} + extern int tg_nop(struct task_group *tg, void *data); #ifdef CONFIG_FAIR_GROUP_SCHED |