diff --git a/pkg/cluster/manager/check.go b/pkg/cluster/manager/check.go index 35935ef28f..5a89574e93 100644 --- a/pkg/cluster/manager/check.go +++ b/pkg/cluster/manager/check.go @@ -644,7 +644,7 @@ func fixFailedChecks(host string, res *operator.CheckResult, t *task.Builder) (s msg = fmt.Sprintf("will try to %s, reboot might be needed", color.HiBlueString("disable SELinux")) case operator.CheckNameTHP: t.Shell(host, - fmt.Sprintf(`if [ -d %[1]s ]; then echo never > %[1]s/defrag && echo never > %[1]s/enabled; fi`, "/sys/kernel/mm/transparent_hugepage"), + fmt.Sprintf(`if [ -d %[1]s ]; then echo never > %[1]s/enabled; fi`, "/sys/kernel/mm/transparent_hugepage"), "", true) msg = fmt.Sprintf("will try to %s, please check again after reboot", color.HiBlueString("disable THP")) diff --git a/pkg/cluster/operation/check.go b/pkg/cluster/operation/check.go index 682238533b..8258c9364e 100644 --- a/pkg/cluster/operation/check.go +++ b/pkg/cluster/operation/check.go @@ -820,14 +820,14 @@ func CheckFIOResult(rr, rw, lat []byte) []*CheckResult { return results } -// CheckTHP checks THP in /sys/kernel/mm/transparent_hugepage/{enabled,defrag} +// CheckTHP checks THP in /sys/kernel/mm/transparent_hugepage/enabled func CheckTHP(ctx context.Context, e ctxt.Executor) *CheckResult { result := &CheckResult{ Name: CheckNameTHP, } m := module.NewShellModule(module.ShellModuleConfig{ - Command: fmt.Sprintf(`if [ -d %[1]s ]; then cat %[1]s/{enabled,defrag}; fi`, "/sys/kernel/mm/transparent_hugepage"), + Command: fmt.Sprintf(`if [ -d %[1]s ]; then cat %[1]s/enabled; fi`, "/sys/kernel/mm/transparent_hugepage"), Sudo: true, }) stdout, stderr, err := m.Execute(ctx, e)