Zeng Heng (2): resctrl: fix undefined reference to lockdep_is_cpus_held() fs/resctrl: Move rdtgroup_setup_default() out of init.text section
fs/resctrl/rdtgroup.c | 2 +- include/linux/resctrl.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
-- 2.25.1
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I8T2RT
--------------------------------
lockdep_is_cpus_held() will only be compiled by the kernel when CONFIG_HOTPLUG_CPU is defined. Otherwise, kernel test robot would report the following compile error:
ld: vmlinux.o: in function `resctrl_get_domain_from_cpu': include/linux/resctrl.h:291: undefined reference to `lockdep_is_cpus_held'
Reported-by: kernel test robot lkp@intel.com Closes: https://lore.kernel.org/oe-kbuild-all/202401252038.VOiTn1TA-lkp@intel.com/ Signed-off-by: Zeng Heng zengheng4@huawei.com --- include/linux/resctrl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/resctrl.h b/include/linux/resctrl.h index dd34523469a5..f4aeccd78afb 100644 --- a/include/linux/resctrl.h +++ b/include/linux/resctrl.h @@ -300,7 +300,7 @@ resctrl_get_domain_from_cpu(int cpu, struct rdt_resource *r) * about locks this thread holds will lead to false positives. Check * someone is holding the CPUs lock. */ - if (IS_ENABLED(CONFIG_LOCKDEP)) + if (IS_ENABLED(CONFIG_HOTPLUG_CPU) && IS_ENABLED(CONFIG_LOCKDEP)) lockdep_is_cpus_held();
list_for_each_entry_rcu(d, &r->domains, list) {
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I8T2RT
--------------------------------
rdtgroup_setup_default() is declared at .init.text section, but will be called by resctrl_init() located in the .text section, which will lead to incorrect reference.
Here is the compilation error message reported by linker: WARNING: modpost: vmlinux: section mismatch in reference: resctrl_init+0x6c (section: .text) -> rdtgroup_setup_default (section: .init.text)
Reported-by: kernel test robot lkp@intel.com Closes: https://lore.kernel.org/oe-kbuild-all/202401261430.Xq824gQ5-lkp@intel.com/ Signed-off-by: Zeng Heng zengheng4@huawei.com --- fs/resctrl/rdtgroup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c index 20a4962d3e81..1ade368e2631 100644 --- a/fs/resctrl/rdtgroup.c +++ b/fs/resctrl/rdtgroup.c @@ -3758,7 +3758,7 @@ static void rdtgroup_destroy_root(void) rdtgroup_default.kn = NULL; }
-static void __init rdtgroup_setup_default(void) +static void rdtgroup_setup_default(void) { mutex_lock(&rdtgroup_mutex);
反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/openeuler/kernel/pulls/5768 邮件列表地址:https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/I...
FeedBack: The patch(es) which you have sent to kernel@openeuler.org mailing list has been converted to a pull request successfully! Pull request link: https://gitee.com/openeuler/kernel/pulls/5768 Mailing list address: https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/I...