Skip to content

Commit 6131e43

Browse files
feat: Restore Tuned CPU isolation, add Nova pinning and docs
Recommend to prefer Tuned over isolcpu kernel args Co-authored-by: aider (gemini/gemini-2.5-pro) <[email protected]>
1 parent 0f0c5b8 commit 6131e43

File tree

10 files changed

+84
-0
lines changed

10 files changed

+84
-0
lines changed

dt/nova/nova04delta/edpm/nodeset/kustomization.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,18 @@ replacements:
3939
create: true
4040

4141
# Nova compute PCI passthrough customization
42+
- source:
43+
kind: ConfigMap
44+
name: edpm-nodeset-values
45+
fieldPath: data.nova.compute.conf
46+
targets:
47+
- select:
48+
kind: ConfigMap
49+
name: cpu-pinning-nova
50+
fieldPaths:
51+
- data.25-cpu-pinning-nova\.conf
52+
options:
53+
create: true
4254
- source:
4355
kind: ConfigMap
4456
name: edpm-nodeset-values

dt/nova/nova04delta/edpm/nodeset/nova_gpu.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
apiVersion: v1
22
kind: ConfigMap
3+
metadata:
4+
name: cpu-pinning-nova
5+
data:
6+
25-cpu-pinning-nova.conf: _replaced_
7+
---
8+
apiVersion: v1
9+
kind: ConfigMap
310
metadata:
411
name: gpu-nova
512
data:
@@ -13,6 +20,8 @@ spec:
1320
label: dataplane-deployment-nova-custom-gpu
1421
edpmServiceType: nova
1522
dataSources:
23+
- configMapRef:
24+
name: cpu-pinning-nova
1625
- configMapRef:
1726
name: gpu-nova
1827
- secretRef:

dt/nova/nova04delta/edpm/nodeset2/kustomization.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,18 @@ replacements:
3939
create: true
4040

4141
# Nova compute PCI passthrough customization
42+
- source:
43+
kind: ConfigMap
44+
name: edpm-nodeset-values
45+
fieldPath: data.nova.compute.conf
46+
targets:
47+
- select:
48+
kind: ConfigMap
49+
name: cpu-pinning-nova-2
50+
fieldPaths:
51+
- data.25-cpu-pinning-nova\.conf
52+
options:
53+
create: true
4254
- source:
4355
kind: ConfigMap
4456
name: edpm-nodeset-values

dt/nova/nova04delta/edpm/nodeset2/nova_gpu.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
apiVersion: v1
22
kind: ConfigMap
3+
metadata:
4+
name: cpu-pinning-nova-2
5+
data:
6+
25-cpu-pinning-nova.conf: _replaced_
7+
---
8+
apiVersion: v1
9+
kind: ConfigMap
310
metadata:
411
name: gpu-nova-2
512
data:
@@ -13,6 +20,8 @@ spec:
1320
label: dataplane-deployment-nova-custom-gpu
1421
edpmServiceType: nova
1522
dataSources:
23+
- configMapRef:
24+
name: cpu-pinning-nova-2
1625
- configMapRef:
1726
name: gpu-nova-2
1827
- secretRef:

examples/dt/nova/nova04delta/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ The following parameters are crucial for host-level configuration:
2121
* `vfio-pci.ids=10de:20f1`: Instructs the `vfio-pci` driver to claim the specified GPU(s) by their vendor and product IDs at boot time. The example IDs `10de:20f1` are for an NVIDIA A100 GPU.
2222
* `rd.driver.pre=vfio-pci`: Avoids race conditions during boot by loading vfio-pci kernel module early.
2323

24+
* `edpm_tuned_profile` and `edpm_tuned_isolated_cores`: These parameters configure the `tuned` service.
25+
* `edpm_tuned_profile` is set to `cpu-partitioning-powersave` to enable CPU isolation features.
26+
* `edpm_tuned_isolated_cores` specifies the cores to be isolated. For CPU isolation we strongly recommend using the Tuned approach rather than `isolcpus` kernel argument.
27+
2428
* **VFIO-PCI Binding Service**: The `vfio-pci-bind` service in `dt/nova/nova04delta/edpm/nodeset/nova_gpu.yaml` blacklists the `nouveau` and `nvidia` kernel modules to ensure they do not interfere with the `vfio-pci` driver. The service also regenerates the initramfs and grub configuration to apply these changes. A reboot is required for these changes to take effect.
2529

2630
## Nova Configuration
@@ -63,6 +67,8 @@ That is a contrary to the legacy mode where PCI devices used to be requested thr
6367
In addition to PCI device configuration, the `nova.compute.conf` section includes parameters for resource management on the compute node:
6468

6569
* `[DEFAULT]reserved_host_memory_mb`: Specifies the amount of memory (in megabytes) to reserve for the host operating system and other non-OpenStack services. This memory will not be available for allocation to virtual machines.
70+
* `[compute]cpu_shared_set`: A list of physical CPUs that are available for host processes and for virtual machines that do not have dedicated CPUs (i.e., unpinned VMs). These should be the CPUs that are **not** isolated by `edpm_tuned_isolated_cores`.
71+
* `[compute]cpu_dedicated_set`: A list of physical CPUs that are exclusively reserved for virtual machines with dedicated CPU pinning policies. To ensure performance isolation, this list should correspond directly to the CPUs isolated using `edpm_tuned_isolated_cores` parameter.
6672
* `[DEFAULT]reserved_huge_pages`: Defines the number and size of huge pages to reserve for the host, making them unavailable for guest VMs. This configuration works in conjunction with the `hugepages` and `hugepagesz` kernel arguments, which define the total pool of huge pages on the host.
6773

6874
**Note**: In a full device passthrough scenario, the `[devices]enabled_vgpu_types` option in Nova's configuration is not used. This option is specific to mediated device (mdev) configurations.

examples/dt/nova/nova04delta/edpm/nodeset/values.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ data:
4141
# Here, 10de represents NVIDIA Corporation, and 20f1 corresponds to the GA100 [A100 PCIe 40GB] GPU, according to Device Hunt
4242
# https://devicehunt.com/view/type/pci/vendor/10DE/device/20F1
4343
edpm_kernel_args: "default_hugepagesz=1GB hugepagesz=1G hugepages=16 intel_iommu=on iommu=pt vfio-pci.ids=10de:20f1 rd.driver.pre=vfio-pci"
44+
edpm_tuned_profile: "cpu-partitioning-powersave"
45+
edpm_tuned_isolated_cores: "4-23,28-47"
4446
# edpm_network_config
4547
# These vars are edpm_network_config role vars
4648
edpm_network_config_hide_sensitive_logs: false
@@ -138,6 +140,9 @@ data:
138140
reserved_host_memory_mb = 4096
139141
reserved_huge_pages = node:0,size:4,count:524160
140142
reserved_huge_pages = node:1,size:4,count:524160
143+
[compute]
144+
cpu_shared_set = 0-3,24-27
145+
cpu_dedicated_set = 8-23,32-47
141146
migration:
142147
ssh_keys:
143148
private: CHANGEME4

examples/dt/nova/nova04delta/edpm/nodeset2/values.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ data:
4141
# Here, 10de represents NVIDIA Corporation, and 20f1 corresponds to the GA100 [A100 PCIe 40GB] GPU, according to Device Hunt
4242
# https://devicehunt.com/view/type/pci/vendor/10DE/device/20F1
4343
edpm_kernel_args: "default_hugepagesz=1GB hugepagesz=1G hugepages=16 intel_iommu=on iommu=pt vfio-pci.ids=10de:20f1 rd.driver.pre=vfio-pci"
44+
edpm_tuned_profile: "cpu-partitioning-powersave"
45+
edpm_tuned_isolated_cores: "4-23,28-47"
4446
# edpm_network_config
4547
# These vars are edpm_network_config role vars
4648
edpm_network_config_hide_sensitive_logs: false
@@ -138,6 +140,9 @@ data:
138140
reserved_host_memory_mb = 4096
139141
reserved_huge_pages = node:0,size:4,count:524160
140142
reserved_huge_pages = node:1,size:4,count:524160
143+
[compute]
144+
cpu_shared_set = 0-3,24-27
145+
cpu_dedicated_set = 8-23,32-47
141146
migration:
142147
ssh_keys:
143148
private: CHANGEME4

examples/va/nvidia-vfio-passthrough/edpm/nodeset/values.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ data:
4141
# Here, 10de represents NVIDIA Corporation, and 20f1 corresponds to the GA100 [A100 PCIe 40GB] GPU, according to Device Hunt
4242
# https://devicehunt.com/view/type/pci/vendor/10DE/device/20F1
4343
edpm_kernel_args: "default_hugepagesz=1GB hugepagesz=1G hugepages=16 intel_iommu=on iommu=pt vfio-pci.ids=10de:20f1 rd.driver.pre=vfio-pci"
44+
edpm_tuned_profile: "cpu-partitioning-powersave"
45+
edpm_tuned_isolated_cores: "4-23,28-47"
4446
# edpm_network_config
4547
# These vars are edpm_network_config role vars
4648
edpm_network_config_hide_sensitive_logs: false
@@ -138,6 +140,9 @@ data:
138140
reserved_host_memory_mb = 4096
139141
reserved_huge_pages = node:0,size:4,count:524160
140142
reserved_huge_pages = node:1,size:4,count:524160
143+
[compute]
144+
cpu_shared_set = 0-3,24-27
145+
cpu_dedicated_set = 8-23,32-47
141146
migration:
142147
ssh_keys:
143148
private: CHANGEME4

va/nvidia-vfio-passthrough/edpm/nodeset/kustomization.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,18 @@ replacements:
3939
create: true
4040

4141
# Nova compute PCI passthrough customization
42+
- source:
43+
kind: ConfigMap
44+
name: edpm-nodeset-values
45+
fieldPath: data.nova.compute.conf
46+
targets:
47+
- select:
48+
kind: ConfigMap
49+
name: cpu-pinning-nova
50+
fieldPaths:
51+
- data.25-cpu-pinning-nova\.conf
52+
options:
53+
create: true
4254
- source:
4355
kind: ConfigMap
4456
name: edpm-nodeset-values

va/nvidia-vfio-passthrough/edpm/nodeset/nova_gpu.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
apiVersion: v1
22
kind: ConfigMap
3+
metadata:
4+
name: cpu-pinning-nova
5+
data:
6+
25-cpu-pinning-nova.conf: _replaced_
7+
---
8+
apiVersion: v1
9+
kind: ConfigMap
310
metadata:
411
name: gpu-nova
512
data:
@@ -13,6 +20,8 @@ spec:
1320
label: dataplane-deployment-nova-custom-gpu
1421
edpmServiceType: nova
1522
dataSources:
23+
- configMapRef:
24+
name: cpu-pinning-nova
1625
- configMapRef:
1726
name: gpu-nova
1827
- secretRef:

0 commit comments

Comments
 (0)