aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChengming Zhou <[email protected]>2022-08-26 00:41:03 +0800
committerPeter Zijlstra <[email protected]>2022-09-09 11:08:31 +0200
commit58d8c2586cedb8a67f6f0dffa5eaed0f89135b39 (patch)
treecf0117e07e405e560f6a489692ffc5daba0f47aa
parentc530a3c716b963625e43aa915e0de6b4d1ce8ad9 (diff)
sched/psi: Don't create cgroup PSI files when psi_disabled
commit 3958e2d0c34e ("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 <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Acked-by: Johannes Weiner <[email protected]> Link: https://lore.kernel.org/r/[email protected]
-rw-r--r--kernel/cgroup/cgroup.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index 718a70c01c04..96aefdb064bb 100644
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -3780,6 +3780,9 @@ static void cgroup_pressure_release(struct kernfs_open_file *of)
bool cgroup_psi_enabled(void)
{
+ if (static_branch_likely(&psi_disabled))
+ return false;
+
return (cgroup_feature_disable_mask & (1 << OPT_FEATURE_PRESSURE)) == 0;
}