Skip to content

Commit 64ac7c4

Browse files
authored
Merge pull request #48469 from jsturtevant/win-mem-cpu-feautre
Docs: Windows CPU and Memory Affinity
2 parents fc73d7b + 7f411ed commit 64ac7c4

File tree

4 files changed

+62
-3
lines changed

4 files changed

+62
-3
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
title: WindowsCPUAndMemoryAffinity
3+
content_type: feature_gate
4+
5+
_build:
6+
list: never
7+
render: false
8+
9+
stages:
10+
- stage: alpha
11+
defaultValue: false
12+
fromVersion: "1.32"
13+
---
14+
15+
Add CPU and Memory Affinity support to Windows nodes with [CPUManager](/docs/tasks/administer-cluster/cpu-management-policies/#windows-support),
16+
[MemoryManager](/docs/tasks/administer-cluster/memory-manager/#windows-support)
17+
and topology manager.

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,14 @@ However, in workloads where CPU cache affinity and scheduling latency
4949
significantly affect workload performance, the kubelet allows alternative CPU
5050
management policies to determine some placement preferences on the node.
5151

52+
## Windows Support
53+
54+
{{< feature-state feature_gate_name="WindowsCPUAndMemoryAffinity" >}}
55+
56+
CPU Manager support can be enabled on Windows by using the `WindowsCPUAndMemoryAffinity` feature gate
57+
and it requires support in the container runtime.
58+
Once the feature gate is enabled, follow the steps below to configure the [CPU manager policy](#configuration).
59+
5260
### Configuration
5361

5462
The CPU Manager policy is set with the `--cpu-manager-policy` kubelet

content/en/docs/tasks/administer-cluster/memory-manager.md

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Preceding v1.22, the `kubelet` must be started with the following flag:
4646

4747
in order to enable the Memory Manager feature.
4848

49-
## How Memory Manager Operates?
49+
## How does the Memory Manager Operate?
5050

5151
The Memory Manager currently offers the guaranteed memory (and hugepages) allocation
5252
for Pods in Guaranteed QoS class.
@@ -57,7 +57,7 @@ prepare and deploy a `Guaranteed` pod as illustrated in the section
5757

5858
The Memory Manager is a Hint Provider, and it provides topology hints for
5959
the Topology Manager which then aligns the requested resources according to these topology hints.
60-
It also enforces `cgroups` (i.e. `cpuset.mems`) for pods.
60+
On Linux, it also enforces `cgroups` (i.e. `cpuset.mems`) for pods.
6161
The complete flow diagram concerning pod admission and deployment process is illustrated in
6262
[Memory Manager KEP: Design Overview][4] and below:
6363

@@ -91,6 +91,14 @@ The problem has been solved as elaborated in
9191
Also, reference [Memory Manager KEP: Simulation - how the Memory Manager works? (by examples)][1]
9292
illustrates how the management of groups occurs.
9393

94+
### Windows Support
95+
96+
{{< feature-state feature_gate_name="WindowsCPUAndMemoryAffinity" >}}
97+
98+
Windows support can be enabled via the `WindowsCPUAndMemoryAffinity` feature gate
99+
and it requires support in the container runtime.
100+
Only the [BestEffort Policy](#policy-best-effort) is supported on Windows.
101+
94102
## Memory Manager configuration
95103

96104
Other Managers should be first pre-configured. Next, the Memory Manager feature should be enabled
@@ -103,7 +111,8 @@ node stability (section [Reserved memory flag](#reserved-memory-flag)).
103111
Memory Manager supports two policies. You can select a policy via a `kubelet` flag `--memory-manager-policy`:
104112

105113
* `None` (default)
106-
* `Static`
114+
* `Static` (Linux only)
115+
* `BestEffort` (Windows Only)
107116

108117
#### None policy {#policy-none}
109118

@@ -123,6 +132,24 @@ In the case of the `BestEffort` or `Burstable` pod, the `Static` Memory Manager
123132
the default topology hint as there is no request for the guaranteed memory,
124133
and does not reserve the memory in the internal [NodeMap][2] object.
125134

135+
This policy is only supported on Linux.
136+
137+
#### BestEffort policy {#policy-best-effort}
138+
139+
{{< feature-state feature_gate_name="WindowsCPUAndMemoryAffinity" >}}
140+
141+
This policy is only supported on Windows.
142+
143+
On Windows, NUMA node assignment works differently than Linux.
144+
There is no mechanism to ensure that Memory access only comes from a specific NUMA node.
145+
Instead the Windows scheduler will select the most optimal NUMA node based on the CPU(s) assignments.
146+
It is possible that Windows might use other NUMA nodes if deemed optimal by the Windows scheduler.
147+
148+
The policy does track the amount of memory available and requested through the internal [NodeMap][2].
149+
The memory manager will make a best effort at ensuring that enough memory is available on
150+
a NUMA node before making the assignment.
151+
This means that in most cases memory assignment should function as expected.
152+
126153
### Reserved memory flag
127154

128155
The [Node Allocatable](/docs/tasks/administer-cluster/reserve-compute-resources/) mechanism

content/en/docs/tasks/administer-cluster/topology-manager.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,13 @@ the pod can be accepted or rejected from the node based on the selected hint.
5858
The hint is then stored in the Topology Manager for use by the *Hint Providers* when making the
5959
resource allocation decisions.
6060

61+
## Windows Support
62+
63+
{{< feature-state feature_gate_name="WindowsCPUAndMemoryAffinity" >}}
64+
65+
The Topology Manager support can be enabled on Windows by using the `WindowsCPUAndMemoryAffinity` feature gate and
66+
it requires support in the container runtime.
67+
6168
## Topology manager scopes and policies
6269

6370
The Topology Manager currently:

0 commit comments

Comments
 (0)