From: Chen Wandun chenwandun@huawei.com
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I8BCV4
-------------------------------
Feature of psi cgroup v1 should only enable when open CONFIG_PSI_CGROUP_V1.
Signed-off-by: Chen Wandun chenwandun@huawei.com Signed-off-by: Lu Jialin lujialin4@huawei.com --- include/linux/psi.h | 2 +- kernel/sched/cpuacct.c | 4 ++-- kernel/sched/psi.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/linux/psi.h b/include/linux/psi.h index 9e15596968d0..c4bb670225ee 100644 --- a/include/linux/psi.h +++ b/include/linux/psi.h @@ -14,7 +14,7 @@ struct css_set; extern struct static_key_false psi_disabled; extern struct psi_group psi_system;
-extern struct static_key_false psi_v1_disabled; +extern struct static_key_true psi_v1_disabled;
void psi_init(void);
diff --git a/kernel/sched/cpuacct.c b/kernel/sched/cpuacct.c index 28ed182b6801..1fa89f338e51 100644 --- a/kernel/sched/cpuacct.c +++ b/kernel/sched/cpuacct.c @@ -383,8 +383,8 @@ static int __init setup_psi_v1(char *str) int ret;
ret = kstrtobool(str, &psi_v1_enable); - if (!psi_v1_enable) - static_branch_enable(&psi_v1_disabled); + if (psi_v1_enable) + static_branch_disable(&psi_v1_disabled);
return ret == 0; } diff --git a/kernel/sched/psi.c b/kernel/sched/psi.c index 7c255aabc8ac..3623b113b8f0 100644 --- a/kernel/sched/psi.c +++ b/kernel/sched/psi.c @@ -156,7 +156,7 @@ static int psi_bug __read_mostly;
DEFINE_STATIC_KEY_FALSE(psi_disabled); -DEFINE_STATIC_KEY_FALSE(psi_v1_disabled); +DEFINE_STATIC_KEY_TRUE(psi_v1_disabled);
#ifdef CONFIG_PSI_DEFAULT_DISABLED static bool psi_enable;