Skip to content

Commit bbc4615

Browse files
Vikas ShivappaKAGA-KOKO
authored andcommitted
x86/intel_rdt/mbm: Fix MBM overflow handler during CPU hotplug
When a CPU is dying, the overflow worker is canceled and rescheduled on a different CPU in the same domain. But if the timer is already about to expire this essentially doubles the interval which might result in a non detected overflow. Cancel the overflow worker and reschedule it immediately on a different CPU in same domain. The work could be flushed as well, but that would reschedule it on the same CPU. [ tglx: Rewrote changelog once again ] Reported-by: Thomas Gleixner <[email protected]> Signed-off-by: Vikas Shivappa <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected]
1 parent a9110b5 commit bbc4615

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

arch/x86/kernel/cpu/intel_rdt.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ static int domain_setup_mon_state(struct rdt_resource *r, struct rdt_domain *d)
447447

448448
if (is_mbm_enabled()) {
449449
INIT_DELAYED_WORK(&d->mbm_over, mbm_handle_overflow);
450-
mbm_setup_overflow_handler(d);
450+
mbm_setup_overflow_handler(d, MBM_OVERFLOW_INTERVAL);
451451
}
452452

453453
return 0;
@@ -540,7 +540,7 @@ static void domain_remove_cpu(int cpu, struct rdt_resource *r)
540540
} else if (r == &rdt_resources_all[RDT_RESOURCE_L3] &&
541541
cpu == d->mbm_work_cpu && is_mbm_enabled()) {
542542
cancel_delayed_work(&d->mbm_over);
543-
mbm_setup_overflow_handler(d);
543+
mbm_setup_overflow_handler(d, 0);
544544
}
545545
}
546546

arch/x86/kernel/cpu/intel_rdt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ void mkdir_mondata_subdir_allrdtgrp(struct rdt_resource *r,
422422
struct rdt_domain *d);
423423
void mon_event_read(struct rmid_read *rr, struct rdt_domain *d,
424424
struct rdtgroup *rdtgrp, int evtid, int first);
425-
void mbm_setup_overflow_handler(struct rdt_domain *dom);
425+
void mbm_setup_overflow_handler(struct rdt_domain *dom, unsigned long delay_ms);
426426
void mbm_handle_overflow(struct work_struct *work);
427427

428428
#endif /* _ASM_X86_INTEL_RDT_H */

arch/x86/kernel/cpu/intel_rdt_monitor.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,9 +417,9 @@ void mbm_handle_overflow(struct work_struct *work)
417417
mutex_unlock(&rdtgroup_mutex);
418418
}
419419

420-
void mbm_setup_overflow_handler(struct rdt_domain *dom)
420+
void mbm_setup_overflow_handler(struct rdt_domain *dom, unsigned long delay_ms)
421421
{
422-
unsigned long delay = msecs_to_jiffies(MBM_OVERFLOW_INTERVAL);
422+
unsigned long delay = msecs_to_jiffies(delay_ms);
423423
int cpu;
424424

425425
if (!static_branch_likely(&rdt_enable_key))

arch/x86/kernel/cpu/intel_rdt_rdtgroup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1140,7 +1140,7 @@ static struct dentry *rdt_mount(struct file_system_type *fs_type,
11401140
if (is_mbm_enabled()) {
11411141
r = &rdt_resources_all[RDT_RESOURCE_L3];
11421142
list_for_each_entry(dom, &r->domains, list)
1143-
mbm_setup_overflow_handler(dom);
1143+
mbm_setup_overflow_handler(dom, MBM_OVERFLOW_INTERVAL);
11441144
}
11451145

11461146
goto out;

0 commit comments

Comments
 (0)