Lines Matching refs:tg
1200 int tg_nop(struct task_group *tg, void *data) in tg_nop() argument
1704 struct task_group *tg = &root_task_group; in uclamp_update_root_tg() local
1706 uclamp_se_set(&tg->uclamp_req[UCLAMP_MIN], in uclamp_update_root_tg()
1708 uclamp_se_set(&tg->uclamp_req[UCLAMP_MAX], in uclamp_update_root_tg()
4432 struct task_group *tg; in sched_post_fork() local
4437 tg = container_of(kargs->cset->subsys[cpu_cgrp_id], in sched_post_fork()
4439 p->sched_task_group = autogroup_task_group(p, tg); in sched_post_fork()
9696 static inline void alloc_uclamp_sched_group(struct task_group *tg, in alloc_uclamp_sched_group() argument
9703 uclamp_se_set(&tg->uclamp_req[clamp_id], in alloc_uclamp_sched_group()
9705 tg->uclamp[clamp_id] = parent->uclamp[clamp_id]; in alloc_uclamp_sched_group()
9710 static void sched_free_group(struct task_group *tg) in sched_free_group() argument
9712 free_fair_sched_group(tg); in sched_free_group()
9713 free_rt_sched_group(tg); in sched_free_group()
9714 autogroup_free(tg); in sched_free_group()
9715 kmem_cache_free(task_group_cache, tg); in sched_free_group()
9723 static void sched_unregister_group(struct task_group *tg) in sched_unregister_group() argument
9725 unregister_fair_sched_group(tg); in sched_unregister_group()
9726 unregister_rt_sched_group(tg); in sched_unregister_group()
9731 call_rcu(&tg->rcu, sched_free_group_rcu); in sched_unregister_group()
9737 struct task_group *tg; in sched_create_group() local
9739 tg = kmem_cache_alloc(task_group_cache, GFP_KERNEL | __GFP_ZERO); in sched_create_group()
9740 if (!tg) in sched_create_group()
9743 if (!alloc_fair_sched_group(tg, parent)) in sched_create_group()
9746 if (!alloc_rt_sched_group(tg, parent)) in sched_create_group()
9749 alloc_uclamp_sched_group(tg, parent); in sched_create_group()
9751 return tg; in sched_create_group()
9754 sched_free_group(tg); in sched_create_group()
9758 void sched_online_group(struct task_group *tg, struct task_group *parent) in sched_online_group() argument
9763 list_add_rcu(&tg->list, &task_groups); in sched_online_group()
9768 tg->parent = parent; in sched_online_group()
9769 INIT_LIST_HEAD(&tg->children); in sched_online_group()
9770 list_add_rcu(&tg->siblings, &parent->children); in sched_online_group()
9773 online_fair_sched_group(tg); in sched_online_group()
9783 void sched_destroy_group(struct task_group *tg) in sched_destroy_group() argument
9786 call_rcu(&tg->rcu, sched_unregister_group_rcu); in sched_destroy_group()
9789 void sched_release_group(struct task_group *tg) in sched_release_group() argument
9807 list_del_rcu(&tg->list); in sched_release_group()
9808 list_del_rcu(&tg->siblings); in sched_release_group()
9814 struct task_group *tg; in sched_change_group() local
9821 tg = container_of(task_css_check(tsk, cpu_cgrp_id, true), in sched_change_group()
9823 tg = autogroup_task_group(tsk, tg); in sched_change_group()
9824 tsk->sched_task_group = tg; in sched_change_group()
9885 struct task_group *tg; in cpu_cgroup_css_alloc() local
9892 tg = sched_create_group(parent); in cpu_cgroup_css_alloc()
9893 if (IS_ERR(tg)) in cpu_cgroup_css_alloc()
9896 return &tg->css; in cpu_cgroup_css_alloc()
9902 struct task_group *tg = css_tg(css); in cpu_cgroup_css_online() local
9906 sched_online_group(tg, parent); in cpu_cgroup_css_online()
9922 struct task_group *tg = css_tg(css); in cpu_cgroup_css_released() local
9924 sched_release_group(tg); in cpu_cgroup_css_released()
9929 struct task_group *tg = css_tg(css); in cpu_cgroup_css_free() local
9934 sched_unregister_group(tg); in cpu_cgroup_css_free()
10091 struct task_group *tg; in cpu_uclamp_write() local
10102 tg = css_tg(of_css(of)); in cpu_uclamp_write()
10103 if (tg->uclamp_req[clamp_id].value != req.util) in cpu_uclamp_write()
10104 uclamp_se_set(&tg->uclamp_req[clamp_id], req.util, false); in cpu_uclamp_write()
10110 tg->uclamp_pct[clamp_id] = req.percent; in cpu_uclamp_write()
10138 struct task_group *tg; in cpu_uclamp_print() local
10144 tg = css_tg(seq_css(sf)); in cpu_uclamp_print()
10145 util_clamp = tg->uclamp_req[clamp_id].value; in cpu_uclamp_print()
10153 percent = tg->uclamp_pct[clamp_id]; in cpu_uclamp_print()
10183 struct task_group *tg = css_tg(css); in cpu_shares_read_u64() local
10185 return (u64) scale_load_down(tg->shares); in cpu_shares_read_u64()
10196 static int __cfs_schedulable(struct task_group *tg, u64 period, u64 runtime);
10198 static int tg_set_cfs_bandwidth(struct task_group *tg, u64 period, u64 quota, in tg_set_cfs_bandwidth() argument
10202 struct cfs_bandwidth *cfs_b = &tg->cfs_bandwidth; in tg_set_cfs_bandwidth()
10204 if (tg == &root_task_group) in tg_set_cfs_bandwidth()
10239 ret = __cfs_schedulable(tg, period, quota); in tg_set_cfs_bandwidth()
10265 struct cfs_rq *cfs_rq = tg->cfs_rq[i]; in tg_set_cfs_bandwidth()
10286 static int tg_set_cfs_quota(struct task_group *tg, long cfs_quota_us) in tg_set_cfs_quota() argument
10290 period = ktime_to_ns(tg->cfs_bandwidth.period); in tg_set_cfs_quota()
10291 burst = tg->cfs_bandwidth.burst; in tg_set_cfs_quota()
10299 return tg_set_cfs_bandwidth(tg, period, quota, burst); in tg_set_cfs_quota()
10302 static long tg_get_cfs_quota(struct task_group *tg) in tg_get_cfs_quota() argument
10306 if (tg->cfs_bandwidth.quota == RUNTIME_INF) in tg_get_cfs_quota()
10309 quota_us = tg->cfs_bandwidth.quota; in tg_get_cfs_quota()
10315 static int tg_set_cfs_period(struct task_group *tg, long cfs_period_us) in tg_set_cfs_period() argument
10323 quota = tg->cfs_bandwidth.quota; in tg_set_cfs_period()
10324 burst = tg->cfs_bandwidth.burst; in tg_set_cfs_period()
10326 return tg_set_cfs_bandwidth(tg, period, quota, burst); in tg_set_cfs_period()
10329 static long tg_get_cfs_period(struct task_group *tg) in tg_get_cfs_period() argument
10333 cfs_period_us = ktime_to_ns(tg->cfs_bandwidth.period); in tg_get_cfs_period()
10339 static int tg_set_cfs_burst(struct task_group *tg, long cfs_burst_us) in tg_set_cfs_burst() argument
10347 period = ktime_to_ns(tg->cfs_bandwidth.period); in tg_set_cfs_burst()
10348 quota = tg->cfs_bandwidth.quota; in tg_set_cfs_burst()
10350 return tg_set_cfs_bandwidth(tg, period, quota, burst); in tg_set_cfs_burst()
10353 static long tg_get_cfs_burst(struct task_group *tg) in tg_get_cfs_burst() argument
10357 burst_us = tg->cfs_bandwidth.burst; in tg_get_cfs_burst()
10400 struct task_group *tg; member
10408 static u64 normalize_cfs_quota(struct task_group *tg, in normalize_cfs_quota() argument
10413 if (tg == d->tg) { in normalize_cfs_quota()
10417 period = tg_get_cfs_period(tg); in normalize_cfs_quota()
10418 quota = tg_get_cfs_quota(tg); in normalize_cfs_quota()
10428 static int tg_cfs_schedulable_down(struct task_group *tg, void *data) in tg_cfs_schedulable_down() argument
10431 struct cfs_bandwidth *cfs_b = &tg->cfs_bandwidth; in tg_cfs_schedulable_down()
10434 if (!tg->parent) { in tg_cfs_schedulable_down()
10437 struct cfs_bandwidth *parent_b = &tg->parent->cfs_bandwidth; in tg_cfs_schedulable_down()
10439 quota = normalize_cfs_quota(tg, d); in tg_cfs_schedulable_down()
10461 static int __cfs_schedulable(struct task_group *tg, u64 period, u64 quota) in __cfs_schedulable() argument
10465 .tg = tg, in __cfs_schedulable()
10484 struct task_group *tg = css_tg(seq_css(sf)); in cpu_cfs_stat_show() local
10485 struct cfs_bandwidth *cfs_b = &tg->cfs_bandwidth; in cpu_cfs_stat_show()
10491 if (schedstat_enabled() && tg != &root_task_group) { in cpu_cfs_stat_show()
10497 stats = __schedstats_from_se(tg->se[i]); in cpu_cfs_stat_show()
10620 struct task_group *tg = css_tg(css); in cpu_extra_stat_show() local
10621 struct cfs_bandwidth *cfs_b = &tg->cfs_bandwidth; in cpu_extra_stat_show()
10645 struct task_group *tg = css_tg(css); in cpu_weight_read_u64() local
10646 u64 weight = scale_load_down(tg->shares); in cpu_weight_read_u64()
10739 struct task_group *tg = css_tg(seq_css(sf)); in cpu_max_show() local
10741 cpu_period_quota_print(sf, tg_get_cfs_period(tg), tg_get_cfs_quota(tg)); in cpu_max_show()
10748 struct task_group *tg = css_tg(of_css(of)); in cpu_max_write() local
10749 u64 period = tg_get_cfs_period(tg); in cpu_max_write()
10750 u64 burst = tg_get_cfs_burst(tg); in cpu_max_write()
10756 ret = tg_set_cfs_bandwidth(tg, period, quota, burst); in cpu_max_write()