psi: dont alloc memory for psi by default

Memory about struct psi_group is allocated by default for
each cgroup even if psi_disabled is true, in this case, these
allocated memory is waste, so alloc memory for struct psi_group
only when psi_disabled is false.

Signed-off-by: Chen Wandun <chenwandun@huawei.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Tejun Heo <tj@kernel.org>
This commit is contained in:
Chen Wandun
2022-05-26 20:26:56 +08:00
committed by Tejun Heo
parent e71e60cd74
commit 5f69a6577b
4 changed files with 19 additions and 12 deletions

View File

@@ -674,7 +674,7 @@ static inline void pr_cont_cgroup_path(struct cgroup *cgrp)
static inline struct psi_group *cgroup_psi(struct cgroup *cgrp)
{
return &cgrp->psi;
return cgrp->psi;
}
bool cgroup_psi_enabled(void);