patches.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/7] x86/resctrl: Add support for Sub-NUMA cluster (SNC) systems
@ 2023-01-26 18:41 Tony Luck
  2023-01-26 18:41 ` [PATCH 1/7] x86/resctrl: Refactor in preparation for node-scoped resources Tony Luck
                   ` (7 more replies)
  0 siblings, 8 replies; 34+ messages in thread
From: Tony Luck @ 2023-01-26 18:41 UTC (permalink / raw)
  To: Fenghua Yu, Reinette Chatre, Peter Newman, Jonathan Corbet, x86
  Cc: Shaopeng Tan, James Morse, Jamie Iles, Babu Moger, linux-kernel,
	linux-doc, patches, Tony Luck

Intel server systems starting with Skylake support a mode that logically
partitions each socket. E.g. when partitioned two ways, half the cores,
L3 cache, and memory controllers are allocated to each of the partitions.
This may reduce average latency to access L3 cache and memory, with the
tradeoff that only half the L3 cache is available for subnode-local memory
access.

The existing Linux resctrl system mishandles RDT monitoring on systems
with SNC mode enabled.

But, with some simple changes, this can be fixed. When SNC mode is
enabled, the RDT RMID counters are also partitioned with the low numbered
counters going to the first partition, and the high numbered counters
to the second partition[1]. The key is to adjust the RMID value written
to the IA32_PQR_ASSOC MSR on context switch, and the value written to
the IA32_QM_EVTSEL when reading out counters, and to change the scaling
factor that was read from CPUID(0xf,1).EBX

E.g. in 2-way Sub-NUMA cluster with 200 RMID counters there are only
100 available counters to the resctrl code. When running on the first
SNC node RMID values 0..99 are used as before. But when running on the
second node, a task that is assigned resctrl rmid=10 must load 10+100
into IA32_PQR_ASSOC to use RMID counter 110.

There should be no changes to functionality on other architectures,
or on Intel systems with SNC disabled, where snc_ways == 1.

-Tony

[1] Some systems also support a 4-way split. All the above still
applies, just need to account for cores, cache, memory controllers
and RMID counters being divided four ways instead of two.

Tony Luck (7):
  x86/resctrl: Refactor in preparation for node-scoped resources
  x86/resctrl: Remove hard code of RDT_RESOURCE_L3 in monitor.c
  x86/resctrl: Add a new node-scoped resource to rdt_resources_all[]
  x86/resctrl: Add code to setup monitoring at L3 or NODE scope.
  x86/resctrl: Add a new "snc_ways" file to the monitoring info
    directory.
  x86/resctrl: Update documentation with Sub-NUMA cluster changes
  x86/resctrl: Determine if Sub-NUMA Cluster is enabled and initialize.

 Documentation/x86/resctrl.rst             | 15 +++-
 include/linux/resctrl.h                   |  4 +-
 arch/x86/include/asm/resctrl.h            |  4 +-
 arch/x86/kernel/cpu/resctrl/internal.h    |  9 +++
 arch/x86/kernel/cpu/resctrl/core.c        | 83 ++++++++++++++++++++---
 arch/x86/kernel/cpu/resctrl/monitor.c     | 24 ++++---
 arch/x86/kernel/cpu/resctrl/pseudo_lock.c |  2 +-
 arch/x86/kernel/cpu/resctrl/rdtgroup.c    | 22 +++++-
 8 files changed, 136 insertions(+), 27 deletions(-)

-- 
2.39.1


^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2023-03-14 20:23 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-26 18:41 [PATCH 0/7] x86/resctrl: Add support for Sub-NUMA cluster (SNC) systems Tony Luck
2023-01-26 18:41 ` [PATCH 1/7] x86/resctrl: Refactor in preparation for node-scoped resources Tony Luck
2023-01-26 18:41 ` [PATCH 2/7] x86/resctrl: Remove hard code of RDT_RESOURCE_L3 in monitor.c Tony Luck
2023-01-27  4:51   ` Yu, Fenghua
2023-01-26 18:41 ` [PATCH 3/7] x86/resctrl: Add a new node-scoped resource to rdt_resources_all[] Tony Luck
2023-01-27  5:24   ` Yu, Fenghua
2023-01-27 16:02     ` Peter Newman
2023-01-27 18:23     ` Luck, Tony
2023-01-28  2:25       ` Yu, Fenghua
2023-01-28  2:22   ` Yu, Fenghua
2023-01-28  2:36   ` Yu, Fenghua
2023-01-30 19:04     ` Luck, Tony
2023-02-28 14:27   ` Moger, Babu
2023-02-28 17:05     ` Luck, Tony
2023-01-26 18:41 ` [PATCH 4/7] x86/resctrl: Add code to setup monitoring at L3 or NODE scope Tony Luck
2023-02-28 17:13   ` James Morse
2023-02-28 17:28     ` Luck, Tony
2023-01-26 18:41 ` [PATCH 5/7] x86/resctrl: Add a new "snc_ways" file to the monitoring info directory Tony Luck
2023-02-28 17:13   ` James Morse
2023-02-28 17:44     ` Luck, Tony
2023-03-03 18:32       ` James Morse
2023-01-26 18:41 ` [PATCH 6/7] x86/resctrl: Update documentation with Sub-NUMA cluster changes Tony Luck
2023-02-28 17:14   ` James Morse
2023-01-26 18:41 ` [PATCH 7/7] x86/resctrl: Determine if Sub-NUMA Cluster is enabled and initialize Tony Luck
2023-02-27 13:30   ` Peter Newman
2023-03-10 17:30     ` Tony Luck
2023-03-13  9:19       ` Peter Newman
2023-03-13 16:38         ` Luck, Tony
2023-02-28 19:51   ` Moger, Babu
2023-03-14 20:23     ` Tony Luck
     [not found]   ` <85d7e70a-b9c8-6551-b1ac-229b51ee18d7@amd.com>
2023-02-28 20:39     ` Luck, Tony
2023-02-28 22:31       ` Moger, Babu
2023-02-28 17:12 ` [PATCH 0/7] x86/resctrl: Add support for Sub-NUMA cluster (SNC) systems James Morse
2023-02-28 18:04   ` Luck, Tony

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).