Skip to content

Commit

Permalink
x86/resctrl: Remove lockdep annotation that triggers false positive
Browse files Browse the repository at this point in the history
get_domain_from_cpu() walks a list of domains to find the one that
contains the specified CPU. This needs to be protected against races
with CPU hotplug when the list is modified. It has recently gained
a lockdep annotation to check this.

The lockdep annotation causes false positives when called via IPI as the
lock is held, but by another process. Remove it.

  [ bp: Refresh it ontop of x86/cache. ]

Fixes: fb70081 ("x86/resctrl: Separate arch and fs resctrl locks")
Reported-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: James Morse <james.morse@arm.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/all/ZdUSwOM9UUNpw84Y@agluck-desk3
  • Loading branch information
James Morse authored and Borislav Petkov (AMD) committed Feb 22, 2024
1 parent fb70081 commit c0d848f
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions arch/x86/kernel/cpu/resctrl/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -362,15 +362,6 @@ struct rdt_domain *get_domain_from_cpu(int cpu, struct rdt_resource *r)
{
struct rdt_domain *d;

/*
* Walking r->domains, ensure it can't race with cpuhp.
* Because this is called via IPI by rdt_ctrl_update(), assertions
* about locks this thread holds will lead to false positives. Check
* someone is holding the CPUs lock.
*/
if (IS_ENABLED(CONFIG_HOTPLUG_CPU) && IS_ENABLED(CONFIG_LOCKDEP))
WARN_ON_ONCE(!lockdep_is_cpus_held());

list_for_each_entry(d, &r->domains, list) {
/* Find the domain that contains this CPU */
if (cpumask_test_cpu(cpu, &d->cpu_mask))
Expand Down

0 comments on commit c0d848f

Please sign in to comment.