Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

sched: Make cpu_shares_read_u64() use tg_weight()

Move tg_weight() upward and make cpu_shares_read_u64() use it too. This
makes the weight retrieval shared between cgroup v1 and v2 paths and will be
used to implement cgroup support for sched_ext.

No functional changes.

Signed-off-by: Tejun Heo <tj@kernel.org>

+6 -8
+6 -8
kernel/sched/core.c
··· 9194 9194 #endif /* CONFIG_UCLAMP_TASK_GROUP */ 9195 9195 9196 9196 #ifdef CONFIG_FAIR_GROUP_SCHED 9197 + static unsigned long tg_weight(struct task_group *tg) 9198 + { 9199 + return scale_load_down(tg->shares); 9200 + } 9201 + 9197 9202 static int cpu_shares_write_u64(struct cgroup_subsys_state *css, 9198 9203 struct cftype *cftype, u64 shareval) 9199 9204 { ··· 9210 9205 static u64 cpu_shares_read_u64(struct cgroup_subsys_state *css, 9211 9206 struct cftype *cft) 9212 9207 { 9213 - struct task_group *tg = css_tg(css); 9214 - 9215 - return (u64) scale_load_down(tg->shares); 9208 + return tg_weight(css_tg(css)); 9216 9209 } 9217 9210 9218 9211 #ifdef CONFIG_CFS_BANDWIDTH ··· 9711 9708 } 9712 9709 9713 9710 #ifdef CONFIG_FAIR_GROUP_SCHED 9714 - 9715 - static unsigned long tg_weight(struct task_group *tg) 9716 - { 9717 - return scale_load_down(tg->shares); 9718 - } 9719 9711 9720 9712 static u64 cpu_weight_read_u64(struct cgroup_subsys_state *css, 9721 9713 struct cftype *cft)