Skip to content

Commit b581326

Browse files
authored
Merge pull request #48340 from wongchar/split-uncorecache-awareness
Add prefer-align-cpus-by-uncorecache feature gate
2 parents cb8e5a7 + ace1c3b commit b581326

File tree

3 files changed

+43
-2
lines changed

3 files changed

+43
-2
lines changed

content/en/docs/concepts/policy/node-resource-managers.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,15 @@ The following policy options exist for the static CPU management policy:
189189
`align-by-socket` (alpha, hidden by default)
190190
: Align CPUs by physical package / socket boundary, rather than logical NUMA boundaries (available since Kubernetes v1.25)
191191
`distribute-cpus-across-cores` (alpha, hidden by default)
192-
: allocate virtual cores, sometimes called hardware threads, across different physical cores (available since Kubernetes v1.31)
192+
: Allocate virtual cores, sometimes called hardware threads, across different physical cores (available since Kubernetes v1.31)
193193
`distribute-cpus-across-numa` (alpha, hidden by default)
194-
: spread CPUs across different NUMA domains, aiming for an even balance between the selected domains (available since Kubernetes v1.23)
194+
: Spread CPUs across different NUMA domains, aiming for an even balance between the selected domains (available since Kubernetes v1.23)
195195
`full-pcpus-only` (beta, visible by default)
196196
: Always allocate full physical cores (available since Kubernetes v1.22)
197+
`strict-cpu-reservation` (alpha, hidden by default)
198+
: Prevent all the pods regardless of their Quality of Service class to run on reserved CPUs (available since Kubernetes v1.32)
199+
`prefer-align-cpus-by-uncorecache` (alpha, hidden by default)
200+
: Align CPUs by uncore (Last-Level) cache boundary on a best-effort way (available since Kubernetes v1.32)
197201

198202
You can toggle groups of options on and off based upon their maturity level
199203
using the following feature gates:
@@ -273,6 +277,24 @@ of `reservedSystemCPUs` and cause host OS services to starve in real life deploy
273277
If the `strict-cpu-reservation` policy option is enabled, the static policy will not allow
274278
any workload to use the CPU cores specified in `reservedSystemCPUs`.
275279

280+
##### `prefer-align-cpus-by-uncorecache`
281+
282+
If the `prefer-align-cpus-by-uncorecache` policy is specified, the static policy
283+
will allocate CPU resources for individual containers such that all CPUs assigned
284+
to a container share the same uncore cache block (also known as the Last-Level Cache
285+
or LLC). By default, the `CPUManager` will tightly pack CPU assignments which can
286+
result in containers being assigned CPUs from multiple uncore caches. This option
287+
enables the `CPUManager` to allocate CPUs in a way that maximizes the efficient use
288+
of the uncore cache. Allocation is performed on a best-effort basis, aiming to
289+
affine as many CPUs as possible within the same uncore cache. If the container's
290+
CPU requirement exceeds the CPU capacity of a single uncore cache, the `CPUManager`
291+
minimizes the number of uncore caches used in order to maintain optimal uncore
292+
cache alignment. Specific workloads can benefit in performance from the reduction
293+
of inter-cache latency and noisy neighbors at the cache level. If the `CPUManager`
294+
cannot align optimally while the node has sufficient resources, the container will
295+
still be admitted using the default packed behavior.
296+
297+
276298
## Memory Management Policies
277299

278300
{{< feature-state feature_gate_name="MemoryManager" >}}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
title: PreferAlignCpusByUncoreCache
3+
content_type: feature_gate
4+
_build:
5+
list: never
6+
render: false
7+
8+
stages:
9+
- stage: alpha
10+
defaultValue: false
11+
fromVersion: "1.32"
12+
---
13+
When `PreferAlignCpusByUncoreCache` is enabled while the CPU Manager Policy is set to `static`, containers within a `Guaranteed` pod will individually be aligned to an uncore cache group at a best-effort policy. This feature can optimize performance for certain cache-sensitive workloads by minimizing the cpu allocation across uncore caches.

content/en/docs/tasks/administer-cluster/cpu-management-policies.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ The following policy options exist for the static `CPUManager` policy:
156156
* `align-by-socket` (alpha, hidden by default) (1.25 or higher)
157157
* `distribute-cpus-across-cores` (alpha, hidden by default) (1.31 or higher)
158158
* `strict-cpu-reservation` (alpha, hidden by default) (1.32 or higher)
159+
* `prefer-align-cpus-by-uncorecache` (alpha, hidden by default) (1.32 or higher)
159160

160161
The `full-pcpus-only` option can be enabled by adding `full-pcpus-only=true` to
161162
the CPUManager policy options.
@@ -176,5 +177,10 @@ options together at this moment.
176177
The `strict-cpu-reservation` option can be enabled by adding `strict-cpu-reservation=true` to
177178
the CPUManager policy options followed by removing the `/var/lib/kubelet/cpu_manager_state` file and restart kubelet.
178179

180+
The `prefer-align-cpus-by-uncorecache` option can be enabled by adding the
181+
`prefer-align-cpus-by-uncorecache` to the `CPUManager` policy options. If
182+
incompatible options are used, the kubelet will fail to start with the error
183+
explained in the logs.
184+
179185
For mode detail about the behavior of the individual options you can configure, please refer to the
180186
[Node ResourceManagers](/docs/concepts/policy/node-resource-managers) documentation.

0 commit comments

Comments
 (0)