Skip to content

Commit

Permalink
Merge pull request #7441 from vbotbuildovich/backport-6446-7403-v22.3…
Browse files Browse the repository at this point in the history
….x-727

[v22.3.x] rpk clocksource tuner only enabled for amd
  • Loading branch information
r-vasquez authored Nov 22, 2022
2 parents 21d91dd + dbacfe6 commit 6b2aa3c
Show file tree
Hide file tree
Showing 2 changed files with 18 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
12 changes: 12 additions & 0 deletions tests/rptest/tests/rpk_tuner_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,18 @@ def test_tune_list(self):
swappiness true true
transparent_hugepages true true
'''

uname = str(node.account.ssh_output("uname -m"))
# either x86-64 or i386.
is_not_x86 = "86" not in uname

# Clocksource is only available for x86 architectures.
expected = expected.replace(
"clocksource true true ",
"clocksource true false Clocksource setting not available for this architecture"
) if is_not_x86 else expected

output = rpk.tune("list")
self.logger.debug(output)

assert output == expected

0 comments on commit 6b2aa3c

Please sign in to comment.