From 2d26e39382687b7b833d765b0703e3159906e968 Mon Sep 17 00:00:00 2001 From: Pu Lehui Date: Thu, 29 May 2025 07:26:20 +0000 Subject: [PATCH 1/2] interference: Fix compilation issue hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/ICAOAT -------------------------------- kernel test robot reported the following compilation error: drivers/base/arch_topology.c:811:2: error: implicit declaration of function 'cgroup_ifs_set_smt' [-Werror=implicit-function-declaration] Let's fix it by adding cgroup_ifs_set_smt related header file. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202505282112.qVJOB1Zd-lkp@intel.com/ Fixes: edff31302c6d ("interference: Add smt interference track support") Signed-off-by: Pu Lehui --- drivers/base/arch_topology.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c index a26169094712..b776ba4127db 100644 --- a/drivers/base/arch_topology.c +++ b/drivers/base/arch_topology.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include -- Gitee From 9f399c2bb79db048fe5fd4d71d4e09a436707522 Mon Sep 17 00:00:00 2001 From: Xu Kuohai Date: Thu, 29 May 2025 07:26:21 +0000 Subject: [PATCH 2/2] interference: Fix sub-cgroup can't show in cgroup v1 hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/ICAOAT -------------------------------- Fix sub-cgroup can't show in cgroup v1 Signed-off-by: Xu Kuohai Signed-off-by: Pu Lehui --- include/linux/cgroup.h | 4 ++++ init/init_task.c | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index d6f43bca5ecb..29fb4556d123 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h @@ -905,6 +905,10 @@ static inline struct cgroup_ifs *cgroup_ifs(struct cgroup *cgrp) static inline struct cgroup_ifs *task_ifs(struct task_struct *task) { +#ifdef CONFIG_CGROUP_CPUACCT + if (!cgroup_subsys_on_dfl(cpuacct_cgrp_subsys)) + return cgroup_ifs(task_cgroup(task, cpuacct_cgrp_id)); +#endif return cgroup_ifs(task_dfl_cgroup(task)); } diff --git a/init/init_task.c b/init/init_task.c index 1adc17149558..275ae1f2ff1c 100644 --- a/init/init_task.c +++ b/init/init_task.c @@ -12,6 +12,7 @@ #include #include #include +#include #include @@ -61,6 +62,10 @@ static struct task_struct_resvd init_task_struct_resvd = { .task = &init_task, }; +#ifdef CONFIG_CGROUP_IFS +static struct css_set dummy_css; +#endif + /* * Set up the first task table, touch at your own risk!. Base=0, * limit=0x1fffff (=2MB) @@ -168,6 +173,9 @@ struct task_struct init_task .mems_allowed_seq = SEQCNT_SPINLOCK_ZERO(init_task.mems_allowed_seq, &init_task.alloc_lock), #endif +#ifdef CONFIG_CGROUP_IFS + .cgroups = &dummy_css, +#endif #ifdef CONFIG_RT_MUTEXES .pi_waiters = RB_ROOT_CACHED, .pi_top_task = NULL, -- Gitee