Skip to content

x86/mtrr: Allow MTRR updates on multiple CPUs in parallel

Juergen Gross lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 10 repliesIn review
  2. v14 patches 1 replySuperseded

Changes in v2 from the cover letter

- fix a function comment header in patch 2

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4x86/mtrr: Move cache_enable() and cache_disable() to mtrr/generic.carch/x86/include/asm/cacheinfo.h arch/x86/include/asm/mtrr.h arch/x86/kernel/cpu/cacheinfo.c +1 more+82 -850 replies
2/4x86/mtrr: Introduce MTRR work state structurearch/x86/kernel/cpu/mtrr/generic.c+33 -270 replies
3/4x86/mtrr: Add a prepare_set hook to mtrr_opsarch/x86/kernel/cpu/mtrr/generic.c arch/x86/kernel/cpu/mtrr/mtrr.c arch/x86/kernel/cpu/mtrr/mtrr.h+31 -60 replies
4/4x86/mtrr: Drop cache_disable_lockarch/x86/kernel/cpu/mtrr/generic.c+0 -120 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/4] x86/mtrr: Allow MTRR updates on multiple CPUs in parallel

Today MTRR updates are serialized to not happen on multiple CPUs at the same time, as the related coding is using global variables.

On huge machines with lots of CPUs this can result in problems, as such updates are happening through stop_machine(), which will call the MTRR update function with interrupts off on all CPUs at the same time. The interrupts will be switched on only after the last CPU has finished the MTRR update. As the update is required to run in uncached mode, it can take easily several milliseconds on each CPU, resulting in the whole process to need several seconds. This in turn can cause the watchdog to trigger and to recognize a hard system lockup.

This series is changing the behavior by allowing the MTRR update to happen on all CPUs in parallel.

Changes in V2:
- fix a function comment header in patch 2

Juergen Gross (4):
x86/mtrr: Move cache_enable() and cache_disable() to mtrr/generic.c x86/mtrr: Introduce MTRR work state structure
x86/mtrr: Add a prepare_set hook to mtrr_ops
x86/mtrr: Drop cache_disable_lock

 arch/x86/include/asm/cacheinfo.h   |   2 -
 arch/x86/include/asm/mtrr.h        |   2 -
 arch/x86/kernel/cpu/cacheinfo.c    |  80 +----------------
 arch/x86/kernel/cpu/mtrr/generic.c | 139 ++++++++++++++++++++++++-----
 arch/x86/kernel/cpu/mtrr/mtrr.c    |   3 +
 arch/x86/kernel/cpu/mtrr/mtrr.h    |   2 +
 6 files changed, 122 insertions(+), 106 deletions(-)
Signature · 1 line
2.52.0