From 41be3946e792aafc554cbec6d36d0a10d775a11c Mon Sep 17 00:00:00 2001 From: Rogger Vasquez Date: Mon, 21 Nov 2022 16:31:45 -0500 Subject: [PATCH] rpk: run clocksource tuner only in amd Our recommended clocksource is tsc, which is only present for x86 architectures In arch != amd rpk will show that the tuner is not available and print: Clocksource setting not available for this architecture Instead of: Preferred clocksource 'tsc' not available --- src/go/rpk/pkg/tuners/clocksource.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/go/rpk/pkg/tuners/clocksource.go b/src/go/rpk/pkg/tuners/clocksource.go index dcfcb0095c31..8e11bc5ddc2a 100644 --- a/src/go/rpk/pkg/tuners/clocksource.go +++ b/src/go/rpk/pkg/tuners/clocksource.go @@ -11,6 +11,7 @@ package tuners import ( "fmt" + "runtime" "strings" "github.com/redpanda-data/redpanda/src/go/rpk/pkg/tuners/executors" @@ -50,6 +51,10 @@ func NewClockSourceTuner(fs afero.Fs, executor executors.Executor) Tunable { return NewTuneResult(false) }, func() (bool, string) { + // tsc clocksource is only available in x86 architectures. + if runtime.GOARCH != "amd64" && runtime.GOARCH != "386" { + return false, "Clocksource setting not available for this architecture" + } content, err := afero.ReadFile(fs, "/sys/devices/system/clocksource/clocksource0/available_clocksource") if err != nil { @@ -63,7 +68,7 @@ func NewClockSourceTuner(fs afero.Fs, executor executors.Executor) Tunable { } } return false, fmt.Sprintf( - "Preferred clocksource '%s' not avaialable", preferredClkSource) + "Preferred clocksource '%s' not available", preferredClkSource) }, executor.IsLazy(), )