Lines Matching refs:tg
741 int tg_nop(struct task_group *tg, void *data) in tg_nop() argument
1098 struct task_group *tg = &root_task_group; in uclamp_update_root_tg() local
1100 uclamp_se_set(&tg->uclamp_req[UCLAMP_MIN], in uclamp_update_root_tg()
1102 uclamp_se_set(&tg->uclamp_req[UCLAMP_MAX], in uclamp_update_root_tg()
6915 static inline void alloc_uclamp_sched_group(struct task_group *tg, in alloc_uclamp_sched_group() argument
6922 uclamp_se_set(&tg->uclamp_req[clamp_id], in alloc_uclamp_sched_group()
6924 tg->uclamp[clamp_id] = parent->uclamp[clamp_id]; in alloc_uclamp_sched_group()
6929 static void sched_free_group(struct task_group *tg) in sched_free_group() argument
6931 free_fair_sched_group(tg); in sched_free_group()
6932 free_rt_sched_group(tg); in sched_free_group()
6933 autogroup_free(tg); in sched_free_group()
6934 kmem_cache_free(task_group_cache, tg); in sched_free_group()
6940 struct task_group *tg; in sched_create_group() local
6942 tg = kmem_cache_alloc(task_group_cache, GFP_KERNEL | __GFP_ZERO); in sched_create_group()
6943 if (!tg) in sched_create_group()
6946 if (!alloc_fair_sched_group(tg, parent)) in sched_create_group()
6949 if (!alloc_rt_sched_group(tg, parent)) in sched_create_group()
6952 alloc_uclamp_sched_group(tg, parent); in sched_create_group()
6954 return tg; in sched_create_group()
6957 sched_free_group(tg); in sched_create_group()
6961 void sched_online_group(struct task_group *tg, struct task_group *parent) in sched_online_group() argument
6966 list_add_rcu(&tg->list, &task_groups); in sched_online_group()
6971 tg->parent = parent; in sched_online_group()
6972 INIT_LIST_HEAD(&tg->children); in sched_online_group()
6973 list_add_rcu(&tg->siblings, &parent->children); in sched_online_group()
6976 online_fair_sched_group(tg); in sched_online_group()
6986 void sched_destroy_group(struct task_group *tg) in sched_destroy_group() argument
6989 call_rcu(&tg->rcu, sched_free_group_rcu); in sched_destroy_group()
6992 void sched_offline_group(struct task_group *tg) in sched_offline_group() argument
6997 unregister_fair_sched_group(tg); in sched_offline_group()
7000 list_del_rcu(&tg->list); in sched_offline_group()
7001 list_del_rcu(&tg->siblings); in sched_offline_group()
7007 struct task_group *tg; in sched_change_group() local
7014 tg = container_of(task_css_check(tsk, cpu_cgrp_id, true), in sched_change_group()
7016 tg = autogroup_task_group(tsk, tg); in sched_change_group()
7017 tsk->sched_task_group = tg; in sched_change_group()
7071 struct task_group *tg; in cpu_cgroup_css_alloc() local
7078 tg = sched_create_group(parent); in cpu_cgroup_css_alloc()
7079 if (IS_ERR(tg)) in cpu_cgroup_css_alloc()
7082 return &tg->css; in cpu_cgroup_css_alloc()
7088 struct task_group *tg = css_tg(css); in cpu_cgroup_css_online() local
7092 sched_online_group(tg, parent); in cpu_cgroup_css_online()
7098 struct task_group *tg = css_tg(css); in cpu_cgroup_css_released() local
7100 sched_offline_group(tg); in cpu_cgroup_css_released()
7105 struct task_group *tg = css_tg(css); in cpu_cgroup_css_free() local
7110 sched_free_group(tg); in cpu_cgroup_css_free()
7264 struct task_group *tg; in cpu_uclamp_write() local
7273 tg = css_tg(of_css(of)); in cpu_uclamp_write()
7274 if (tg->uclamp_req[clamp_id].value != req.util) in cpu_uclamp_write()
7275 uclamp_se_set(&tg->uclamp_req[clamp_id], req.util, false); in cpu_uclamp_write()
7281 tg->uclamp_pct[clamp_id] = req.percent; in cpu_uclamp_write()
7309 struct task_group *tg; in cpu_uclamp_print() local
7315 tg = css_tg(seq_css(sf)); in cpu_uclamp_print()
7316 util_clamp = tg->uclamp_req[clamp_id].value; in cpu_uclamp_print()
7324 percent = tg->uclamp_pct[clamp_id]; in cpu_uclamp_print()
7354 struct task_group *tg = css_tg(css); in cpu_shares_read_u64() local
7356 return (u64) scale_load_down(tg->shares); in cpu_shares_read_u64()
7365 static int __cfs_schedulable(struct task_group *tg, u64 period, u64 runtime);
7367 static int tg_set_cfs_bandwidth(struct task_group *tg, u64 period, u64 quota) in tg_set_cfs_bandwidth() argument
7370 struct cfs_bandwidth *cfs_b = &tg->cfs_bandwidth; in tg_set_cfs_bandwidth()
7372 if (tg == &root_task_group) in tg_set_cfs_bandwidth()
7397 ret = __cfs_schedulable(tg, period, quota); in tg_set_cfs_bandwidth()
7422 struct cfs_rq *cfs_rq = tg->cfs_rq[i]; in tg_set_cfs_bandwidth()
7443 static int tg_set_cfs_quota(struct task_group *tg, long cfs_quota_us) in tg_set_cfs_quota() argument
7447 period = ktime_to_ns(tg->cfs_bandwidth.period); in tg_set_cfs_quota()
7455 return tg_set_cfs_bandwidth(tg, period, quota); in tg_set_cfs_quota()
7458 static long tg_get_cfs_quota(struct task_group *tg) in tg_get_cfs_quota() argument
7462 if (tg->cfs_bandwidth.quota == RUNTIME_INF) in tg_get_cfs_quota()
7465 quota_us = tg->cfs_bandwidth.quota; in tg_get_cfs_quota()
7471 static int tg_set_cfs_period(struct task_group *tg, long cfs_period_us) in tg_set_cfs_period() argument
7479 quota = tg->cfs_bandwidth.quota; in tg_set_cfs_period()
7481 return tg_set_cfs_bandwidth(tg, period, quota); in tg_set_cfs_period()
7484 static long tg_get_cfs_period(struct task_group *tg) in tg_get_cfs_period() argument
7488 cfs_period_us = ktime_to_ns(tg->cfs_bandwidth.period); in tg_get_cfs_period()
7519 struct task_group *tg; member
7527 static u64 normalize_cfs_quota(struct task_group *tg, in normalize_cfs_quota() argument
7532 if (tg == d->tg) { in normalize_cfs_quota()
7536 period = tg_get_cfs_period(tg); in normalize_cfs_quota()
7537 quota = tg_get_cfs_quota(tg); in normalize_cfs_quota()
7547 static int tg_cfs_schedulable_down(struct task_group *tg, void *data) in tg_cfs_schedulable_down() argument
7550 struct cfs_bandwidth *cfs_b = &tg->cfs_bandwidth; in tg_cfs_schedulable_down()
7553 if (!tg->parent) { in tg_cfs_schedulable_down()
7556 struct cfs_bandwidth *parent_b = &tg->parent->cfs_bandwidth; in tg_cfs_schedulable_down()
7558 quota = normalize_cfs_quota(tg, d); in tg_cfs_schedulable_down()
7580 static int __cfs_schedulable(struct task_group *tg, u64 period, u64 quota) in __cfs_schedulable() argument
7584 .tg = tg, in __cfs_schedulable()
7603 struct task_group *tg = css_tg(seq_css(sf)); in cpu_cfs_stat_show() local
7604 struct cfs_bandwidth *cfs_b = &tg->cfs_bandwidth; in cpu_cfs_stat_show()
7610 if (schedstat_enabled() && tg != &root_task_group) { in cpu_cfs_stat_show()
7615 ws += schedstat_val(tg->se[i]->statistics.wait_sum); in cpu_cfs_stat_show()
7709 struct task_group *tg = css_tg(css); in cpu_extra_stat_show() local
7710 struct cfs_bandwidth *cfs_b = &tg->cfs_bandwidth; in cpu_extra_stat_show()
7730 struct task_group *tg = css_tg(css); in cpu_weight_read_u64() local
7731 u64 weight = scale_load_down(tg->shares); in cpu_weight_read_u64()
7824 struct task_group *tg = css_tg(seq_css(sf)); in cpu_max_show() local
7826 cpu_period_quota_print(sf, tg_get_cfs_period(tg), tg_get_cfs_quota(tg)); in cpu_max_show()
7833 struct task_group *tg = css_tg(of_css(of)); in cpu_max_write() local
7834 u64 period = tg_get_cfs_period(tg); in cpu_max_write()
7840 ret = tg_set_cfs_bandwidth(tg, period, quota); in cpu_max_write()