Skip to content

Commit

Permalink
rpk: run clocksource tuner only in amd
Browse files Browse the repository at this point in the history
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
  • Loading branch information
r-vasquez committed Nov 21, 2022
1 parent 74cfa67 commit 41be394
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/go/rpk/pkg/tuners/clocksource.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ package tuners

import (
"fmt"
"runtime"
"strings"

"github.com/redpanda-data/redpanda/src/go/rpk/pkg/tuners/executors"
Expand Down Expand Up @@ -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 {
Expand All @@ -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(),
)
Expand Down

0 comments on commit 41be394

Please sign in to comment.