From: Chen Wandun chenwandun@huawei.com
hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I8QUNW
-------------------------------
Feature of psi cgroup v1 should only enable when open CONFIG_PSI_CGROUP_V1.
Signed-off-by: Chen Wandun chenwandun@huawei.com Conflict: include/linux/psi.h kernel/sched/psi.c 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 44cb1358737b..49afe8d1cde6 100644 --- a/include/linux/psi.h +++ b/include/linux/psi.h @@ -15,7 +15,7 @@ struct css_set; #ifdef CONFIG_PSI
extern struct static_key_false psi_disabled; -extern struct static_key_false psi_v1_disabled; +extern struct static_key_true psi_v1_disabled; extern struct psi_group psi_system;
void psi_init(void); diff --git a/kernel/sched/cpuacct.c b/kernel/sched/cpuacct.c index 4e71caf232d3..0fd1b207f133 100644 --- a/kernel/sched/cpuacct.c +++ b/kernel/sched/cpuacct.c @@ -371,8 +371,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 3bbd229a7567..7aec8161b693 100644 --- a/kernel/sched/psi.c +++ b/kernel/sched/psi.c @@ -142,7 +142,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); static DEFINE_STATIC_KEY_TRUE(psi_cgroups_enabled);
#ifdef CONFIG_PSI_DEFAULT_DISABLED