Skip to content

x86/resctrl: Pass domain to target CPU

Tony Luck lkml 3 versions – Applied

Status from this message: The following commit has been merged into the x86/cache branch of tip:

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest2 patches 6 repliesApplied
  2. v42 patches 8 repliesSuperseded
  3. v32 patches 4 repliesSuperseded

Patches in v5 Applied

#Subject and filesSizeRepliesApplied
1/2x86/resctrl: Pass domain to target CPUarch/x86/kernel/cpu/resctrl/core.c arch/x86/kernel/cpu/resctrl/ctrlmondata.c arch/x86/kernel/cpu/resctrl/internal.h +1 more+17 -522 replies
2/2x86/resctrl: Simplify call convention for MSR update functionsarch/x86/kernel/cpu/resctrl/core.c arch/x86/kernel/cpu/resctrl/ctrlmondata.c arch/x86/kernel/cpu/resctrl/internal.h+18 -271 reply

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchMaciej Wieczor-RetmanReinette ChatreJames MorseBabu Moger
1/2T-b R-b R-b R-b
2/2T-b R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v5 thread

Cover letter [PATCH v5 0/2] x86/resctrl: Pass domain to target CPU

reset_all_ctrls() and resctrl_arch_update_domains() use on_each_cpu_mask() to call rdt_ctrl_update() on potentially one CPU from each domain.

But this means rdt_ctrl_update() needs to figure out which domain to apply changes to. Doing so requires a search of all domains in a resource, which can only be done safely if cpus_lock is held. Both callers do hold this lock, but there isn't a way for a function called on another CPU via IPI to verify this.

Commit c0d848fcb09d ("x86/resctrl: Remove lockdep annotation that triggers false positive") removed the incorrect assertions.

Add the target domain to the msr_param structure and
call rdt_ctrl_update() for each domain separately using smp_call_function_single(). This means that rdt_ctrl_update() doesn't need to search for the domain and get_domain_from_cpu() can safely assert that the cpus_lock is held since the remaining callers do not use IPI.

---
Changes since V4: Link: https://lore.kernel.org/all/[email protected]/

Reinette: Only assign "cpu" once in resctrl_arch_update_domains() [but see change from James below]

James: Use smp_call_function_any() instead of cpumask_any() + smp_call_function_single() to avoid unnecessary IPI in both resctrl_arch_update_domains() and reset_all_ctrls(). This eliminates a need for the "cpu" local variable.

Tony Luck (2):
x86/resctrl: Pass domain to target CPU
x86/resctrl: Simplify call convention for MSR update functions

 arch/x86/kernel/cpu/resctrl/internal.h    |  5 ++-
 arch/x86/kernel/cpu/resctrl/core.c        | 55 +++++++++--------------
 arch/x86/kernel/cpu/resctrl/ctrlmondata.c | 40 ++++-------------
 arch/x86/kernel/cpu/resctrl/rdtgroup.c    | 12 +----
 4 files changed, 34 insertions(+), 78 deletions(-)

base-commit: c0d848fcb09d80a5f48b99f85e448185125ef59f

Signature · 1 line
2.43.0