-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add basic kernel tuning functionality #47
Conversation
Almost done. Trying to find the right invocation for |
54b3da9
to
4b1222c
Compare
Re-linking the MCO issue for implementing day-2 changes: openshift/machine-config-operator#388 Note that the implementation of that could write the file and call |
Updated per requests |
Note: Keeping as WIP until the updated |
Updated per @jlebon's review |
Still need to check |
|
Checks /etc/pivot/kernel-args for argument changes. This early version only supports bare arguments that are in the whitelist. See conversation at openshift/machine-config-operator#576 Signed-off-by: Steve Milner <[email protected]>
squashed |
Removed WIP as it should be in a good state, though I'm going to do some manual testing shortly. |
|
Ready for last set of review/verification. |
} | ||
|
||
checkable := string(content) | ||
if strings.Contains(checkable, arg) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think right now this is OK, but in the future we're clearly going to need to actually parse the cmdline properly because this will e.g. succeed if some other user-editable string in the cmdline contains nosmt
like rd.lvm.lv=janosmt
because their name is "Janos Mountain" or something.
/lgtm |
// Read and parse the file | ||
file, err := os.Open(tuningFilePath) | ||
// Clean up | ||
defer file.Close() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if open fails for any reason (like a not found of the tuningFilePath), this will panic, this statement should go after the error check below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spotted by runcom: openshift#47 (comment)
Spotted by runcom: #47 (comment)
Checks
/etc/pivot/kernel-args
for argument changes. This early version only supports bare arguments that are in the whitelist.See conversation at openshift/machine-config-operator#576
Requires: coreos/rpm-ostree#1796