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

[v22.3.x] rpk clocksource tuner only enabled for amd #7441

Merged
Merged
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
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