Lines Matching refs:tg
3482 static struct cgroup *tg_cgrp(struct task_group *tg) in tg_cgrp() argument
3489 if (tg && tg->css.cgroup) in tg_cgrp()
3490 return tg->css.cgroup; in tg_cgrp()
3495 #define SCX_INIT_TASK_ARGS_CGROUP(tg) .cgroup = tg_cgrp(tg), argument
3499 #define SCX_INIT_TASK_ARGS_CGROUP(tg) argument
4274 void scx_tg_init(struct task_group *tg) in scx_tg_init() argument
4276 tg->scx.weight = CGROUP_WEIGHT_DFL; in scx_tg_init()
4277 tg->scx.bw_period_us = default_bw_period_us(); in scx_tg_init()
4278 tg->scx.bw_quota_us = RUNTIME_INF; in scx_tg_init()
4279 tg->scx.idle = false; in scx_tg_init()
4282 int scx_tg_online(struct task_group *tg) in scx_tg_online() argument
4287 WARN_ON_ONCE(tg->scx.flags & (SCX_TG_ONLINE | SCX_TG_INITED)); in scx_tg_online()
4292 { .weight = tg->scx.weight, in scx_tg_online()
4293 .bw_period_us = tg->scx.bw_period_us, in scx_tg_online()
4294 .bw_quota_us = tg->scx.bw_quota_us, in scx_tg_online()
4295 .bw_burst_us = tg->scx.bw_burst_us }; in scx_tg_online()
4298 NULL, tg->css.cgroup, &args); in scx_tg_online()
4303 tg->scx.flags |= SCX_TG_ONLINE | SCX_TG_INITED; in scx_tg_online()
4305 tg->scx.flags |= SCX_TG_ONLINE; in scx_tg_online()
4311 void scx_tg_offline(struct task_group *tg) in scx_tg_offline() argument
4315 WARN_ON_ONCE(!(tg->scx.flags & SCX_TG_ONLINE)); in scx_tg_offline()
4318 (tg->scx.flags & SCX_TG_INITED)) in scx_tg_offline()
4319 SCX_CALL_OP(sch, cgroup_exit, NULL, tg->css.cgroup); in scx_tg_offline()
4320 tg->scx.flags &= ~(SCX_TG_ONLINE | SCX_TG_INITED); in scx_tg_offline()
4408 void scx_group_set_weight(struct task_group *tg, unsigned long weight) in scx_group_set_weight() argument
4416 tg->scx.weight != weight) in scx_group_set_weight()
4417 SCX_CALL_OP(sch, cgroup_set_weight, NULL, tg_cgrp(tg), weight); in scx_group_set_weight()
4419 tg->scx.weight = weight; in scx_group_set_weight()
4424 void scx_group_set_idle(struct task_group *tg, bool idle) in scx_group_set_idle() argument
4432 SCX_CALL_OP(sch, cgroup_set_idle, NULL, tg_cgrp(tg), idle); in scx_group_set_idle()
4435 tg->scx.idle = idle; in scx_group_set_idle()
4440 void scx_group_set_bandwidth(struct task_group *tg, in scx_group_set_bandwidth() argument
4449 (tg->scx.bw_period_us != period_us || in scx_group_set_bandwidth()
4450 tg->scx.bw_quota_us != quota_us || in scx_group_set_bandwidth()
4451 tg->scx.bw_burst_us != burst_us)) in scx_group_set_bandwidth()
4453 tg_cgrp(tg), period_us, quota_us, burst_us); in scx_group_set_bandwidth()
4455 tg->scx.bw_period_us = period_us; in scx_group_set_bandwidth()
4456 tg->scx.bw_quota_us = quota_us; in scx_group_set_bandwidth()
4457 tg->scx.bw_burst_us = burst_us; in scx_group_set_bandwidth()
4671 struct task_group *tg = css_tg(css); in scx_cgroup_exit() local
4673 if (!(tg->scx.flags & SCX_TG_INITED)) in scx_cgroup_exit()
4675 tg->scx.flags &= ~SCX_TG_INITED; in scx_cgroup_exit()
4694 struct task_group *tg = css_tg(css); in scx_cgroup_init() local
4696 .weight = tg->scx.weight, in scx_cgroup_init()
4697 .bw_period_us = tg->scx.bw_period_us, in scx_cgroup_init()
4698 .bw_quota_us = tg->scx.bw_quota_us, in scx_cgroup_init()
4699 .bw_burst_us = tg->scx.bw_burst_us, in scx_cgroup_init()
4702 if ((tg->scx.flags & in scx_cgroup_init()
4707 tg->scx.flags |= SCX_TG_INITED; in scx_cgroup_init()
4717 tg->scx.flags |= SCX_TG_INITED; in scx_cgroup_init()
9596 struct task_group *tg = p->sched_task_group; in scx_bpf_task_cgroup() local
9609 cgrp = tg_cgrp(tg); in scx_bpf_task_cgroup()