anolis: support rich container in cgroup v2
ANBZ: #11863 cpuusage data is ready, switch condition to child_task_group to support rich container in cgroup v2. Signed-off-by: Yi Tao <escape@linux.alibaba.com> Acked-by: Tianchen Ding <dtcccc@linux.alibaba.com> Link: https://gitee.com/anolis/cloud-kernel/pulls/4121
This commit is contained in:
parent
d980cb19ad
commit
2283818d15
|
@ -134,7 +134,8 @@ static inline bool in_rich_container(struct task_struct *tsk,
|
|||
if (sysctl_rich_container_enable == 0)
|
||||
return false;
|
||||
|
||||
return (task_active_pid_ns(tsk) != &init_pid_ns) && child_cpuacct(tsk)
|
||||
return (task_active_pid_ns(tsk) != &init_pid_ns)
|
||||
&& child_task_group(tsk)
|
||||
&& !(rc_feature_disable_mask & (1 << id));
|
||||
}
|
||||
|
||||
|
|
|
@ -2311,7 +2311,7 @@ enum rich_container_source {
|
|||
|
||||
#ifdef CONFIG_RICH_CONTAINER
|
||||
void rich_container_source(enum rich_container_source *from);
|
||||
bool child_cpuacct(struct task_struct *tsk);
|
||||
bool child_task_group(struct task_struct *tsk);
|
||||
void rich_container_get_usage(enum rich_container_source from,
|
||||
struct task_struct *reaper, int cpu,
|
||||
struct cpuacct_usage_result *res);
|
||||
|
|
|
@ -1358,11 +1358,11 @@ cpuset_source:
|
|||
}
|
||||
#endif /*CONFIG_RICH_CONTAINER_CG_SWITCH */
|
||||
|
||||
bool child_cpuacct(struct task_struct *tsk)
|
||||
bool child_task_group(struct task_struct *tsk)
|
||||
{
|
||||
struct cpuacct *ca = task_ca(tsk);
|
||||
struct task_group *tg = task_tg(tsk);
|
||||
|
||||
if (ca && ca != &root_cpuacct)
|
||||
if (tg && tg != &root_task_group)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue