Skip to content

Commit

Permalink
Workload Hints E2E: Modify kernel args based on Vendor
Browse files Browse the repository at this point in the history
Adjust Workload Hints E2E test cases to verify kernel
parameters depending on the Vendor in the case of x86_64
where kernel args are changed based on Intel or AMD.

Signed-off-by: Niranjan M.R <[email protected]>
  • Loading branch information
Niranjan M.R committed Dec 19, 2024
1 parent 1c17823 commit 50ded99
Showing 1 changed file with 54 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package __performance_workloadhints
import (
"context"
"fmt"
"github.com/openshift/cluster-node-tuning-operator/test/e2e/performanceprofile/functests/utils/infrastructure"
"path/filepath"
"reflect"
"strconv"
Expand Down Expand Up @@ -55,6 +56,8 @@ var _ = Describe("[rfe_id:49062][workloadHints] Telco friendly workload specific
poolName string
err error
ctx context.Context = context.Background()
isIntel bool
isAMD bool
)

nodeLabel := testutils.NodeSelectorLabels
Expand All @@ -67,6 +70,12 @@ var _ = Describe("[rfe_id:49062][workloadHints] Telco friendly workload specific
profile, err = profiles.GetByNodeLabels(nodeLabel)
Expect(err).ToNot(HaveOccurred())
klog.Infof("using profile: %q", profile.Name)
// Check if one of the nodes is intel or AMD . Here if it's not intel , it's AMD since we are running
// tests only on x86_64 architecture systems
isIntel, err = infrastructure.IsIntel(ctx, &workerRTNodes[0])
Expect(err).ToNot(HaveOccurred(), "Unable to fetch Vendor ID")
isAMD, err = infrastructure.IsAMD(ctx, &workerRTNodes[0])
Expect(err).ToNot(HaveOccurred(), "Unable to fetch Vendor ID")
if !hypershift.IsHypershiftCluster() {
poolName, err = mcps.GetByProfile(profile)
Expect(err).ToNot(HaveOccurred())
Expand Down Expand Up @@ -237,8 +246,10 @@ var _ = Describe("[rfe_id:49062][workloadHints] Telco friendly workload specific
"kernel.sched_rt_runtime_us": "950000",
"vm.stat_interval": "10",
}
kernelParameters := []string{"processor.max_cstate=1", "intel_idle.max_cstate=0"}

kernelParameters := []string{"processor.max_cstate=1"}
if isIntel {
kernelParameters = append(kernelParameters, "intel_idle.max_cstate=0")
}
wg := sync.WaitGroup{}
By("Waiting for TuneD to start on nodes")
for i := 0; i < len(workerRTNodes); i++ {
Expand Down Expand Up @@ -296,8 +307,10 @@ var _ = Describe("[rfe_id:49062][workloadHints] Telco friendly workload specific
"vm.stat_interval": "10",
}
kernelParameters := []string{noHzParam, "tsc=reliable", "nosoftlockup", "nmi_watchdog=0", "mce=off", "skew_tick=1",
"processor.max_cstate=1", "intel_idle.max_cstate=0", "idle=poll"}

"processor.max_cstate=1", "idle=poll"}
if isIntel {
kernelParameters = append(kernelParameters, "intel_idle.max_cstate=0")
}
wg := sync.WaitGroup{}
By("Waiting for TuneD to start on nodes")
for i := 0; i < len(workerRTNodes); i++ {
Expand All @@ -319,6 +332,7 @@ var _ = Describe("[rfe_id:49062][workloadHints] Telco friendly workload specific

By(fmt.Sprintf("Checking TuneD parameters on %q", node.Name))
kernelParameters = append(kernelParameters, utilstuned.AddPstateParameter(context.TODO(), node))

utilstuned.CheckParameters(context.TODO(), node, sysctlMap, kernelParameters, stalldEnabled, rtKernel)
}()
}
Expand Down Expand Up @@ -349,9 +363,14 @@ var _ = Describe("[rfe_id:49062][workloadHints] Telco friendly workload specific
By("Verifying node kernel arguments")
cmdline, err := nodes.ExecCommand(context.TODO(), &workerRTNodes[0], []string{"cat", "/proc/cmdline"})
Expect(err).ToNot(HaveOccurred())
Expect(cmdline).To(ContainSubstring("intel_pstate=passive"))
Expect(cmdline).ToNot(ContainSubstring("intel_pstate=active"))

if isIntel {
Expect(cmdline).To(ContainSubstring("intel_pstate=passive"))
Expect(cmdline).ToNot(ContainSubstring("intel_pstate=active"))
} else {
Expect(cmdline).To(ContainSubstring("amd_pstate=passive"))
Expect(cmdline).ToNot(ContainSubstring("amd_pstate=active"))
}
By("Verifying tuned profile")
key := types.NamespacedName{
Name: components.GetComponentName(profile.Name, components.ProfileNamePerformance),
Expand All @@ -371,6 +390,7 @@ var _ = Describe("[rfe_id:49062][workloadHints] Telco friendly workload specific
// This test requires real hardware with powermanagement settings done on BIOS
// Using numa nodes to check if we are running on real hardware.
checkHardwareCapability(context.TODO(), workerRTNodes)

// First enable HighPowerConsumption
currentWorkloadHints := profile.Spec.WorkloadHints
By("Modifying profile")
Expand Down Expand Up @@ -404,8 +424,10 @@ var _ = Describe("[rfe_id:49062][workloadHints] Telco friendly workload specific
"vm.stat_interval": "10",
}
kernelParameters := []string{noHzParam, "tsc=reliable", "nosoftlockup", "nmi_watchdog=0", "mce=off", "skew_tick=1",
"processor.max_cstate=1", "intel_idle.max_cstate=0", "idle=poll"}

"processor.max_cstate=1", "idle=poll"}
if isIntel {
kernelParameters = append(kernelParameters, "intel_idle.max_cstate=0")
}
wg := sync.WaitGroup{}
By("Waiting for TuneD to start on nodes")
for i := 0; i < len(workerRTNodes); i++ {
Expand Down Expand Up @@ -461,8 +483,15 @@ var _ = Describe("[rfe_id:49062][workloadHints] Telco friendly workload specific
"kernel.sched_rt_runtime_us": "-1",
"vm.stat_interval": "10",
}
kernelParameters = []string{noHzParam, "tsc=reliable", "nosoftlockup", "nmi_watchdog=0", "mce=off", "skew_tick=1", "intel_pstate=passive"}
kernelParameters = []string{noHzParam, "tsc=reliable", "nosoftlockup", "nmi_watchdog=0", "mce=off", "skew_tick=1"}

// Note: Here if it's not intel, its AMD
if isIntel {
kernelParameters = append(kernelParameters, "intel_pstate=passive")
}
if isAMD {
kernelParameters = append(kernelParameters, "amd_pstate=passive")
}
wg = sync.WaitGroup{}
By("Waiting for TuneD to start on nodes")
for i := 0; i < len(workerRTNodes); i++ {
Expand Down Expand Up @@ -526,7 +555,12 @@ var _ = Describe("[rfe_id:49062][workloadHints] Telco friendly workload specific
"vm.stat_interval": "10",
}
kernelParameters := []string{noHzParam, "tsc=reliable", "nosoftlockup", "nmi_watchdog=0", "mce=off", "skew_tick=1", "intel_pstate=passive"}

if isIntel {
kernelParameters = append(kernelParameters, "intel_pstate=passive")
}
if isAMD {
kernelParameters = append(kernelParameters, "amd_pstate=passive")
}
wg := sync.WaitGroup{}
By("Waiting for TuneD to start on nodes")
for i := 0; i < len(workerRTNodes); i++ {
Expand Down Expand Up @@ -581,8 +615,11 @@ var _ = Describe("[rfe_id:49062][workloadHints] Telco friendly workload specific
"vm.stat_interval": "10",
}
kernelParameters = []string{noHzParam, "tsc=reliable", "nosoftlockup", "nmi_watchdog=0", "mce=off", "skew_tick=1",
"processor.max_cstate=1", "intel_idle.max_cstate=0", "idle=poll"}
"processor.max_cstate=1", "idle=poll"}

if isIntel {
kernelParameters = append(kernelParameters, "intel_idle.max_cstate=0")
}
wg = sync.WaitGroup{}
By("Waiting for TuneD to start on nodes")
for i := 0; i < len(workerRTNodes); i++ {
Expand Down Expand Up @@ -648,6 +685,9 @@ var _ = Describe("[rfe_id:49062][workloadHints] Telco friendly workload specific
var err error
// This test requires real hardware with powermanagement settings done on BIOS
// Using numa nodes to check if we are running on real hardware.
if isAMD {
Skip("Crio Powersave annotations test can only be run on Intel systems")
}
checkHardwareCapability(context.TODO(), workerRTNodes)
currentWorkloadHints := profile.Spec.WorkloadHints
profile.Spec.WorkloadHints = &performancev2.WorkloadHints{
Expand Down Expand Up @@ -752,6 +792,9 @@ var _ = Describe("[rfe_id:49062][workloadHints] Telco friendly workload specific
// This test requires real hardware with powermanagement settings done on BIOS
// Using numa nodes to check if we are running on real hardware
var containerCgroup, fullPath string
if isAMD {
Skip("Crio Performance annotations test can only be run on Intel systems")
}
checkHardwareCapability(context.TODO(), workerRTNodes)
currentWorkloadHints := profile.Spec.WorkloadHints
profile.Spec.WorkloadHints = &performancev2.WorkloadHints{
Expand Down

0 comments on commit 50ded99

Please sign in to comment.