From: Joseph Qi joseph.qi@linux.alibaba.com
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I4OF4N
------------------------------------------
Fix the build error if CONFIG_CGROUP_CPUACCT is not enabled.
Fixes: a885e3f9e457 ("psi: support psi under cgroup v1") Signed-off-by: Joseph Qi joseph.qi@linux.alibaba.com Reviewed-by: Xunlei Pang xlpang@linux.alibaba.com Signed-off-by: Chen Wandun chenwandun@huawei.com Reviewed-by: Kefeng Wang wangkefeng.wang@huawei.com Reviewed-by: Kefeng Wang wangkefeng.wang@huawei.com Signed-off-by: Zheng Zengkai zhengzengkai@huawei.com --- kernel/sched/psi.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/kernel/sched/psi.c b/kernel/sched/psi.c index 9f363830e40d..ddbd3d79b988 100644 --- a/kernel/sched/psi.c +++ b/kernel/sched/psi.c @@ -756,7 +756,11 @@ static struct psi_group *iterate_groups(struct task_struct *task, void **iter) if (static_branch_likely(&psi_v1_disabled)) cgroup = task->cgroups->dfl_cgrp; else +#ifdef CONFIG_CGROUP_CPUACCT cgroup = task_cgroup(task, cpuacct_cgrp_id); +#else + cgroup = NULL; +#endif } else if (*iter == &psi_system) return NULL; else