Skip to content

Commit 859dc4e

Browse files
committed
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]>
1 parent a8532fa commit 859dc4e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

kernel/sched/core.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8942,11 +8942,6 @@ void sched_move_task(struct task_struct *tsk)
89428942
}
89438943
}
89448944

8945-
static inline struct task_group *css_tg(struct cgroup_subsys_state *css)
8946-
{
8947-
return css ? container_of(css, struct task_group, css) : NULL;
8948-
}
8949-
89508945
static struct cgroup_subsys_state *
89518946
cpu_cgroup_css_alloc(struct cgroup_subsys_state *parent_css)
89528947
{

kernel/sched/sched.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,11 @@ static inline int walk_tg_tree(tg_visitor down, tg_visitor up, void *data)
514514
return walk_tg_tree_from(&root_task_group, down, up, data);
515515
}
516516

517+
static inline struct task_group *css_tg(struct cgroup_subsys_state *css)
518+
{
519+
return css ? container_of(css, struct task_group, css) : NULL;
520+
}
521+
517522
extern int tg_nop(struct task_group *tg, void *data);
518523

519524
#ifdef CONFIG_FAIR_GROUP_SCHED

0 commit comments

Comments
 (0)