]> Git Repo - J-linux.git/commitdiff
sched/psi: Don't create cgroup PSI files when psi_disabled
authorChengming Zhou <[email protected]>
Thu, 25 Aug 2022 16:41:03 +0000 (00:41 +0800)
committerPeter Zijlstra <[email protected]>
Fri, 9 Sep 2022 09:08:31 +0000 (11:08 +0200)
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]
kernel/cgroup/cgroup.c

index 718a70c01c0450c94406e023e779f29636d6709d..96aefdb064bb3625ae4687d3ae4e4ff2ad56a621 100644 (file)
@@ -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;
 }
 
This page took 0.053123 seconds and 4 git commands to generate.