sched/psi: Don't create cgroup PSI files when psi_disabled

commit 3958e2d0c3 ("cgroup: make per-cgroup pressure stall tracking configurable")
make PSI can be configured to skip per-cgroup stall accounting. And
doesn't expose PSI files in cgroup hierarchy.

This patch do the same thing when psi_disabled.

Signed-off-by: Chengming Zhou <zhouchengming@bytedance.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Link: https://lore.kernel.org/r/20220825164111.29534-3-zhouchengming@bytedance.com
This commit is contained in:
Chengming Zhou 2022-08-26 00:41:03 +08:00 committed by Peter Zijlstra
parent c530a3c716
commit 58d8c2586c
1 changed files with 3 additions and 0 deletions

View File

@ -3780,6 +3780,9 @@ static void cgroup_pressure_release(struct kernfs_open_file *of)
bool cgroup_psi_enabled(void) bool cgroup_psi_enabled(void)
{ {
if (static_branch_likely(&psi_disabled))
return false;
return (cgroup_feature_disable_mask & (1 << OPT_FEATURE_PRESSURE)) == 0; return (cgroup_feature_disable_mask & (1 << OPT_FEATURE_PRESSURE)) == 0;
} }