Lines Matching refs:tg
1299 int tg_nop(struct task_group *tg, void *data) in tg_nop() argument
1781 struct task_group *tg = &root_task_group; in uclamp_update_root_tg() local
1783 uclamp_se_set(&tg->uclamp_req[UCLAMP_MIN], in uclamp_update_root_tg()
1785 uclamp_se_set(&tg->uclamp_req[UCLAMP_MAX], in uclamp_update_root_tg()
4802 struct task_group *tg; in sched_cgroup_fork() local
4803 tg = container_of(kargs->cset->subsys[cpu_cgrp_id], in sched_cgroup_fork()
4805 tg = autogroup_task_group(p, tg); in sched_cgroup_fork()
4806 p->sched_task_group = tg; in sched_cgroup_fork()
10345 static inline void alloc_uclamp_sched_group(struct task_group *tg, in alloc_uclamp_sched_group() argument
10352 uclamp_se_set(&tg->uclamp_req[clamp_id], in alloc_uclamp_sched_group()
10354 tg->uclamp[clamp_id] = parent->uclamp[clamp_id]; in alloc_uclamp_sched_group()
10359 static void sched_free_group(struct task_group *tg) in sched_free_group() argument
10361 free_fair_sched_group(tg); in sched_free_group()
10362 free_rt_sched_group(tg); in sched_free_group()
10363 autogroup_free(tg); in sched_free_group()
10364 kmem_cache_free(task_group_cache, tg); in sched_free_group()
10372 static void sched_unregister_group(struct task_group *tg) in sched_unregister_group() argument
10374 unregister_fair_sched_group(tg); in sched_unregister_group()
10375 unregister_rt_sched_group(tg); in sched_unregister_group()
10380 call_rcu(&tg->rcu, sched_free_group_rcu); in sched_unregister_group()
10386 struct task_group *tg; in sched_create_group() local
10388 tg = kmem_cache_alloc(task_group_cache, GFP_KERNEL | __GFP_ZERO); in sched_create_group()
10389 if (!tg) in sched_create_group()
10392 if (!alloc_fair_sched_group(tg, parent)) in sched_create_group()
10395 if (!alloc_rt_sched_group(tg, parent)) in sched_create_group()
10398 alloc_uclamp_sched_group(tg, parent); in sched_create_group()
10400 return tg; in sched_create_group()
10403 sched_free_group(tg); in sched_create_group()
10407 void sched_online_group(struct task_group *tg, struct task_group *parent) in sched_online_group() argument
10412 list_add_rcu(&tg->list, &task_groups); in sched_online_group()
10417 tg->parent = parent; in sched_online_group()
10418 INIT_LIST_HEAD(&tg->children); in sched_online_group()
10419 list_add_rcu(&tg->siblings, &parent->children); in sched_online_group()
10422 online_fair_sched_group(tg); in sched_online_group()
10432 void sched_destroy_group(struct task_group *tg) in sched_destroy_group() argument
10435 call_rcu(&tg->rcu, sched_unregister_group_rcu); in sched_destroy_group()
10438 void sched_release_group(struct task_group *tg) in sched_release_group() argument
10456 list_del_rcu(&tg->list); in sched_release_group()
10457 list_del_rcu(&tg->siblings); in sched_release_group()
10463 struct task_group *tg; in sched_get_task_group() local
10470 tg = container_of(task_css_check(tsk, cpu_cgrp_id, true), in sched_get_task_group()
10472 tg = autogroup_task_group(tsk, tg); in sched_get_task_group()
10474 return tg; in sched_get_task_group()
10550 struct task_group *tg; in cpu_cgroup_css_alloc() local
10557 tg = sched_create_group(parent); in cpu_cgroup_css_alloc()
10558 if (IS_ERR(tg)) in cpu_cgroup_css_alloc()
10561 return &tg->css; in cpu_cgroup_css_alloc()
10567 struct task_group *tg = css_tg(css); in cpu_cgroup_css_online() local
10571 sched_online_group(tg, parent); in cpu_cgroup_css_online()
10587 struct task_group *tg = css_tg(css); in cpu_cgroup_css_released() local
10589 sched_release_group(tg); in cpu_cgroup_css_released()
10594 struct task_group *tg = css_tg(css); in cpu_cgroup_css_free() local
10599 sched_unregister_group(tg); in cpu_cgroup_css_free()
10722 struct task_group *tg; in cpu_uclamp_write() local
10733 tg = css_tg(of_css(of)); in cpu_uclamp_write()
10734 if (tg->uclamp_req[clamp_id].value != req.util) in cpu_uclamp_write()
10735 uclamp_se_set(&tg->uclamp_req[clamp_id], req.util, false); in cpu_uclamp_write()
10741 tg->uclamp_pct[clamp_id] = req.percent; in cpu_uclamp_write()
10769 struct task_group *tg; in cpu_uclamp_print() local
10775 tg = css_tg(seq_css(sf)); in cpu_uclamp_print()
10776 util_clamp = tg->uclamp_req[clamp_id].value; in cpu_uclamp_print()
10784 percent = tg->uclamp_pct[clamp_id]; in cpu_uclamp_print()
10814 struct task_group *tg = css_tg(css); in cpu_shares_read_u64() local
10816 return (u64) scale_load_down(tg->shares); in cpu_shares_read_u64()
10827 static int __cfs_schedulable(struct task_group *tg, u64 period, u64 runtime);
10829 static int tg_set_cfs_bandwidth(struct task_group *tg, u64 period, u64 quota, in tg_set_cfs_bandwidth() argument
10833 struct cfs_bandwidth *cfs_b = &tg->cfs_bandwidth; in tg_set_cfs_bandwidth()
10835 if (tg == &root_task_group) in tg_set_cfs_bandwidth()
10870 ret = __cfs_schedulable(tg, period, quota); in tg_set_cfs_bandwidth()
10896 struct cfs_rq *cfs_rq = tg->cfs_rq[i]; in tg_set_cfs_bandwidth()
10917 static int tg_set_cfs_quota(struct task_group *tg, long cfs_quota_us) in tg_set_cfs_quota() argument
10921 period = ktime_to_ns(tg->cfs_bandwidth.period); in tg_set_cfs_quota()
10922 burst = tg->cfs_bandwidth.burst; in tg_set_cfs_quota()
10930 return tg_set_cfs_bandwidth(tg, period, quota, burst); in tg_set_cfs_quota()
10933 static long tg_get_cfs_quota(struct task_group *tg) in tg_get_cfs_quota() argument
10937 if (tg->cfs_bandwidth.quota == RUNTIME_INF) in tg_get_cfs_quota()
10940 quota_us = tg->cfs_bandwidth.quota; in tg_get_cfs_quota()
10946 static int tg_set_cfs_period(struct task_group *tg, long cfs_period_us) in tg_set_cfs_period() argument
10954 quota = tg->cfs_bandwidth.quota; in tg_set_cfs_period()
10955 burst = tg->cfs_bandwidth.burst; in tg_set_cfs_period()
10957 return tg_set_cfs_bandwidth(tg, period, quota, burst); in tg_set_cfs_period()
10960 static long tg_get_cfs_period(struct task_group *tg) in tg_get_cfs_period() argument
10964 cfs_period_us = ktime_to_ns(tg->cfs_bandwidth.period); in tg_get_cfs_period()
10970 static int tg_set_cfs_burst(struct task_group *tg, long cfs_burst_us) in tg_set_cfs_burst() argument
10978 period = ktime_to_ns(tg->cfs_bandwidth.period); in tg_set_cfs_burst()
10979 quota = tg->cfs_bandwidth.quota; in tg_set_cfs_burst()
10981 return tg_set_cfs_bandwidth(tg, period, quota, burst); in tg_set_cfs_burst()
10984 static long tg_get_cfs_burst(struct task_group *tg) in tg_get_cfs_burst() argument
10988 burst_us = tg->cfs_bandwidth.burst; in tg_get_cfs_burst()
11031 struct task_group *tg; member
11039 static u64 normalize_cfs_quota(struct task_group *tg, in normalize_cfs_quota() argument
11044 if (tg == d->tg) { in normalize_cfs_quota()
11048 period = tg_get_cfs_period(tg); in normalize_cfs_quota()
11049 quota = tg_get_cfs_quota(tg); in normalize_cfs_quota()
11059 static int tg_cfs_schedulable_down(struct task_group *tg, void *data) in tg_cfs_schedulable_down() argument
11062 struct cfs_bandwidth *cfs_b = &tg->cfs_bandwidth; in tg_cfs_schedulable_down()
11065 if (!tg->parent) { in tg_cfs_schedulable_down()
11068 struct cfs_bandwidth *parent_b = &tg->parent->cfs_bandwidth; in tg_cfs_schedulable_down()
11070 quota = normalize_cfs_quota(tg, d); in tg_cfs_schedulable_down()
11097 static int __cfs_schedulable(struct task_group *tg, u64 period, u64 quota) in __cfs_schedulable() argument
11101 .tg = tg, in __cfs_schedulable()
11120 struct task_group *tg = css_tg(seq_css(sf)); in cpu_cfs_stat_show() local
11121 struct cfs_bandwidth *cfs_b = &tg->cfs_bandwidth; in cpu_cfs_stat_show()
11127 if (schedstat_enabled() && tg != &root_task_group) { in cpu_cfs_stat_show()
11133 stats = __schedstats_from_se(tg->se[i]); in cpu_cfs_stat_show()
11146 static u64 throttled_time_self(struct task_group *tg) in throttled_time_self() argument
11152 total += READ_ONCE(tg->cfs_rq[i]->throttled_clock_self_time); in throttled_time_self()
11160 struct task_group *tg = css_tg(seq_css(sf)); in cpu_cfs_local_stat_show() local
11162 seq_printf(sf, "throttled_time %llu\n", throttled_time_self(tg)); in cpu_cfs_local_stat_show()
11281 struct task_group *tg = css_tg(css); in cpu_extra_stat_show() local
11282 struct cfs_bandwidth *cfs_b = &tg->cfs_bandwidth; in cpu_extra_stat_show()
11307 struct task_group *tg = css_tg(css); in cpu_local_stat_show() local
11310 throttled_self_usec = throttled_time_self(tg); in cpu_local_stat_show()
11324 struct task_group *tg = css_tg(css); in cpu_weight_read_u64() local
11325 u64 weight = scale_load_down(tg->shares); in cpu_weight_read_u64()
11418 struct task_group *tg = css_tg(seq_css(sf)); in cpu_max_show() local
11420 cpu_period_quota_print(sf, tg_get_cfs_period(tg), tg_get_cfs_quota(tg)); in cpu_max_show()
11427 struct task_group *tg = css_tg(of_css(of)); in cpu_max_write() local
11428 u64 period = tg_get_cfs_period(tg); in cpu_max_write()
11429 u64 burst = tg_get_cfs_burst(tg); in cpu_max_write()
11435 ret = tg_set_cfs_bandwidth(tg, period, quota, burst); in cpu_max_write()