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 Signed-off-by: Zheng Zengkai zhengzengkai@huawei.com Signed-off-by: Chen Ridong chenridong@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 15192a436dd0..c66f64ab9f4e 100644 --- a/kernel/sched/psi.c +++ b/kernel/sched/psi.c @@ -1114,12 +1114,16 @@ static inline struct psi_group *task_psi_group(struct task_struct *task) #ifdef CONFIG_CGROUPS if (static_branch_likely(&psi_cgroups_enabled)) { if (task_is_in_psi_v1()) { +#if defined(CONFIG_CGROUP_CPUACCT) struct cgroup *cgroup;
rcu_read_lock(); cgroup = task_cgroup(task, cpuacct_cgrp_id); rcu_read_unlock(); return cgroup_psi(cgroup); +#else + return &psi_system; +#endif } return cgroup_psi(task_dfl_cgroup(task)); }