Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OCPBUGS-43664: Add vendor and architecture specific tuning options #1191

Open
wants to merge 1 commit into
base: release-4.17
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 22 additions & 20 deletions assets/performanceprofile/tuned/openshift-node-performance
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
[main]
summary=Openshift node optimized for deterministic performance at the cost of increased power consumption, focused on low latency network performance. Based on Tuned 2.11 and Cluster node tuning (oc 4.5)

# In case real time kernel is enabled the following include section will be evaluated as:
# include=openshift-node,cpu-partitioning,openshift-node-performance-rt-<PerformanceProfile name>
# Otherwise:
# include=openshift-node,cpu-partitioning
include=openshift-node,cpu-partitioning${f:regex_search_ternary:${f:exec:uname:-r}:rt:,openshift-node-performance-rt-{{.PerformanceProfileName}}:}

# The final result of the include depends on cpu vendor, cpu architecture, and whether the real time kernel is enabled
# The first line will be evaluated based on the CPU vendor and architecture
# This has three possible results:
# include=openshift-node-performance-amd-x86;
# include=openshift-node-performance-arm-aarch64;
# include=openshift-node-performance-intel-x86;
# The second line will be evaluated based on whether the real time kernel is enabled
# This has two possible results:
# openshift-node,cpu-partitioning
# openshift-node,cpu-partitioning,openshift-node-performance-rt-<PerformanceProfile name>
include=openshift-node-performance-${f:lscpu_check:Vendor ID\:\s*GenuineIntel:intel:Vendor ID\:\s*AuthenticAMD:amd:Vendor ID\:\s*ARM:arm}-${f:lscpu_check:Architecture\:\s*x86_64:x86:Architecture\:\s*aarch64:aarch64}-{{.PerformanceProfileName}};
openshift-node,cpu-partitioning${f:regex_search_ternary:${f:exec:uname:-r}:rt:,openshift-node-performance-rt-{{.PerformanceProfileName}}:}

# Inheritance of base profiles legend:
# cpu-partitioning -> network-latency -> latency-performance
Expand All @@ -24,7 +30,6 @@ isolated_cores={{.IsolatedCpus}}
{{end}}

not_isolated_cores_expanded=${f:cpulist_invert:${isolated_cores_expanded}}
automatic_pstate=${f:intel_recommended_pstate}

{{if .PerPodPowerManagement}}
[cpu]
Expand Down Expand Up @@ -135,7 +140,10 @@ initrd_dst_img=
initrd_add_dir=

# overrides cpu-partitioning cmdline
cmdline_cpu_part=+nohz=on rcu_nocbs=${isolated_cores} tuned.non_isolcpus=${not_isolated_cpumask} systemd.cpu_affinity=${not_isolated_cores_expanded} intel_iommu=on iommu=pt
cmdline_cpu_part=+nohz=on rcu_nocbs=${isolated_cores} tuned.non_isolcpus=${not_isolated_cpumask} systemd.cpu_affinity=${not_isolated_cores_expanded}

# No default value but will be composed conditionally based on platform
cmdline_iommu=

{{if .StaticIsolation}}
cmdline_isolation=+isolcpus=domain,managed_irq,${isolated_cores}
Expand All @@ -144,30 +152,24 @@ cmdline_isolation=+isolcpus=managed_irq,${isolated_cores}
{{end}}

{{if .RealTimeHint}}
cmdline_realtime=+nohz_full=${isolated_cores} tsc=reliable nosoftlockup nmi_watchdog=0 mce=off skew_tick=1 rcutree.kthread_prio=11
cmdline_realtime=+nohz_full=${isolated_cores} nosoftlockup skew_tick=1 rcutree.kthread_prio=11
{{end}}

{{if .HighPowerConsumption}}
cmdline_power_performance=+processor.max_cstate=1 intel_idle.max_cstate=0
# No default value but will be composed conditionally based on platform
cmdline_power_performance=
{{end}}

{{if and .HighPowerConsumption .RealTimeHint}}
cmdline_idle_poll=+idle=poll
# No default value but will be composed conditionally based on platform
cmdline_idle_poll=
{{end}}

{{if .DefaultHugepagesSize}}
cmdline_hugepages=+ default_hugepagesz={{.DefaultHugepagesSize}} {{end}} {{if .Hugepages}} {{.Hugepages}} {{end}}

{{if .AdditionalArgs}}
cmdline_additionalArg=+{{.AdditionalArgs}}
{{end}}

{{if .PerPodPowerManagement}}
cmdline_pstate=+intel_pstate=passive
{{else if .HardwareTuning}}
cmdline_pstate=+intel_pstate=active
{{else}}
cmdline_pstate=+intel_pstate=${automatic_pstate}
cmdline_additionalArg=+{{.AdditionalArgs}}
{{end}}

[rtentsk]
Expand Down
25 changes: 25 additions & 0 deletions assets/performanceprofile/tuned/openshift-node-performance-amd-x86
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[main]
summary=Platform specific tuning for AMD x86

[bootloader]
cmdline_iommu_amd=amd_iommu=on iommu=pt

{{if .PerPodPowerManagement}}
cmdline_pstate=amd_pstate=passive
{{else if .HardwareTuning}}
cmdline_pstate=amd_pstate=active
{{else}}
cmdline_pstate=amd_pstate=guided
{{end}}

{{if .RealTimeHint}}
cmdline_realtime_amd=tsc=reliable nmi_watchdog=0 mce=off
{{end}}

{{if .HighPowerConsumption}}
cmdline_power_performance_amd=processor.max_cstate=1
{{end}}

{{if and .HighPowerConsumption .RealTimeHint}}
cmdline_idle_poll_amd=idle=poll
{{end}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[main]
summary=Platform specific tuning for aarch64

[bootloader]
# No cstate for ARM
# No pstate args for ARM

# aarch64 specific tuning options
cmdline_iommu_arm=iommu.passthrough=1
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[main]
summary=Platform specific tuning for Intel x86

[bootloader]
cmdline_iommu_intel=intel_iommu=on iommu=pt

{{if .PerPodPowerManagement}}
cmdline_pstate=intel_pstate=passive
{{else if .HardwareTuning}}
cmdline_pstate=intel_pstate=active
{{else}}
cmdline_pstate=intel_pstate=${f:intel_recommended_pstate}
{{end}}

{{if .RealTimeHint}}
cmdline_realtime_intel=tsc=reliable nmi_watchdog=0 mce=off
{{end}}

{{if .HighPowerConsumption}}
cmdline_power_performance_intel=processor.max_cstate=1 intel_idle.max_cstate=0
{{end}}

{{if and .HighPowerConsumption .RealTimeHint}}
cmdline_idle_poll_intel=idle=poll
{{end}}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ const (
ProfileNamePerformance = "openshift-node-performance"
// ProfileNamePerformanceRT defines the performance real time tuned profile name
ProfileNamePerformanceRT = "openshift-node-performance-rt"
// ProfileNameAmdX86 defines the AMD X86 specific tuning parameters
ProfileNameAmdX86 = "openshift-node-performance-amd-x86"
// ProfileNameArmAarch64 defines the ARM Aarch64 specific tuning parameters
ProfileNameArmAarch64 = "openshift-node-performance-arm-aarch64"
// ProfileNameIntelX86 defines the Intel X86 specific tuning parameters
ProfileNameIntelX86 = "openshift-node-performance-intel-x86"
)

const (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,13 +218,32 @@ func NewNodePerformance(profile *performancev2.PerformanceProfile) (*tunedv1.Tun
if err != nil {
return nil, err
}
name := components.GetComponentName(profile.Name, components.ProfileNamePerformance)

RealTimeKernelProfileData, err := getProfileData(filepath.Join("tuned", components.ProfileNamePerformanceRT), templateArgs)
if err != nil {
return nil, err
}
name := components.GetComponentName(profile.Name, components.ProfileNamePerformance)
RealTimeKernelProfileName := components.GetComponentName(profile.Name, components.ProfileNamePerformanceRT)

AmdX86ProfileData, err := getProfileData(filepath.Join("tuned", components.ProfileNameAmdX86), templateArgs)
if err != nil {
return nil, err
}
AmdX86ProfileName := components.GetComponentName(profile.Name, components.ProfileNameAmdX86)

ArmAarch64ProfileData, err := getProfileData(filepath.Join("tuned", components.ProfileNameArmAarch64), templateArgs)
if err != nil {
return nil, err
}
ArmAarch64ProfileName := components.GetComponentName(profile.Name, components.ProfileNameArmAarch64)

IntelX86ProfileData, err := getProfileData(filepath.Join("tuned", components.ProfileNameIntelX86), templateArgs)
if err != nil {
return nil, err
}
IntelX86ProfileName := components.GetComponentName(profile.Name, components.ProfileNameIntelX86)

profiles := []tunedv1.TunedProfile{
{
Name: &name,
Expand All @@ -234,6 +253,18 @@ func NewNodePerformance(profile *performancev2.PerformanceProfile) (*tunedv1.Tun
Name: &RealTimeKernelProfileName,
Data: &RealTimeKernelProfileData,
},
{
Name: &AmdX86ProfileName,
Data: &AmdX86ProfileData,
},
{
Name: &ArmAarch64ProfileName,
Data: &ArmAarch64ProfileData,
},
{
Name: &IntelX86ProfileName,
Data: &IntelX86ProfileData,
},
}

priority := uint64(20)
Expand Down
Loading