Skip to content

Commit e278af8

Browse files
Qian Caisuryasaimadhu
authored andcommitted
x86/resctrl: Fix an imbalance in domain_remove_cpu()
A system that supports resource monitoring may have multiple resources while not all of these resources are capable of monitoring. Monitoring related state is initialized only for resources that are capable of monitoring and correspondingly this state should subsequently only be removed from these resources that are capable of monitoring. domain_add_cpu() calls domain_setup_mon_state() only when r->mon_capable is true where it will initialize d->mbm_over. However, domain_remove_cpu() calls cancel_delayed_work(&d->mbm_over) without checking r->mon_capable resulting in an attempt to cancel d->mbm_over on all resources, even those that never initialized d->mbm_over because they are not capable of monitoring. Hence, it triggers a debugobjects warning when offlining CPUs because those timer debugobjects are never initialized: ODEBUG: assert_init not available (active state 0) object type: timer_list hint: 0x0 WARNING: CPU: 143 PID: 789 at lib/debugobjects.c:484 debug_print_object Hardware name: HP Synergy 680 Gen9/Synergy 680 Gen9 Compute Module, BIOS I40 05/23/2018 RIP: 0010:debug_print_object Call Trace: debug_object_assert_init del_timer try_to_grab_pending cancel_delayed_work resctrl_offline_cpu cpuhp_invoke_callback cpuhp_thread_fun smpboot_thread_fn kthread ret_from_fork Fixes: e330268 ("x86/intel_rdt/mbm: Handle counter overflow") Signed-off-by: Qian Cai <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Acked-by: Reinette Chatre <[email protected]> Cc: Fenghua Yu <[email protected]> Cc: "H. Peter Anvin" <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: [email protected] Cc: [email protected] Cc: <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: [email protected] Cc: Tony Luck <[email protected]> Cc: Vikas Shivappa <[email protected]> Cc: x86-ml <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent fd69884 commit e278af8

File tree

1 file changed

+1
-1
lines changed
  • arch/x86/kernel/cpu/resctrl

1 file changed

+1
-1
lines changed

arch/x86/kernel/cpu/resctrl/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ static void domain_remove_cpu(int cpu, struct rdt_resource *r)
618618
if (static_branch_unlikely(&rdt_mon_enable_key))
619619
rmdir_mondata_subdir_allrdtgrp(r, d->id);
620620
list_del(&d->list);
621-
if (is_mbm_enabled())
621+
if (r->mon_capable && is_mbm_enabled())
622622
cancel_delayed_work(&d->mbm_over);
623623
if (is_llc_occupancy_enabled() && has_busy_rmid(r, d)) {
624624
/*

0 commit comments

Comments
 (0)