Skip to content

Add basic kernel tuning functionality - #47

Merged
cgwalters merged 1 commit into
openshift:masterfrom
ashcrow:system-tuning
Mar 27, 2019
Merged

cgwalters merged 1 commit into
openshift:masterfrom
ashcrow:system-tuning

Conversation

@ashcrow

@ashcrow ashcrow commented Mar 26, 2019 •

Copy link
Copy Markdown
Member

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

@openshift-ci-robot openshift-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 26, 2019
@ashcrow
ashcrow requested a review from abhinavdahiya March 26, 2019 17:00
@ashcrow

ashcrow commented Mar 26, 2019

Copy link
Copy Markdown
Member Author

Almost done. Trying to find the right invocation for rpm-ostree kargs for bare arguments.

Comment thread cmd/root.go Resolved
Comment thread cmd/root.go Resolved
Comment thread cmd/root.go Resolved
@ashcrow
ashcrow force-pushed the system-tuning branch 2 times, most recently from 54b3da9 to 4b1222c Compare March 26, 2019 18:58
Comment thread cmd/root.go Resolved
Comment thread cmd/root.go Resolved
@cgwalters

Copy link
Copy Markdown
Member

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 pivot.service, but it seems easier to have the MCD directly talk to rpm-ostree.

@ashcrow

ashcrow commented Mar 27, 2019

Copy link
Copy Markdown
Member Author

Updated per requests

Comment thread cmd/root.go Resolved
@ashcrow

ashcrow commented Mar 27, 2019

Copy link
Copy Markdown
Member Author

Note: Keeping as WIP until the updated rpm-ostree is available. /cc @jlebon

Comment thread cmd/root.go Resolved
Comment thread cmd/root.go Resolved
Comment thread cmd/root.go Resolved
Comment thread cmd/root.go Resolved
Comment thread cmd/root.go Resolved
@ashcrow

ashcrow commented Mar 27, 2019

Copy link
Copy Markdown
Member Author

Updated per @jlebon's review

@ashcrow

ashcrow commented Mar 27, 2019

Copy link
Copy Markdown
Member Author

Still need to check /proc/cmdline ... will work on that now.

@ashcrow

ashcrow commented Mar 27, 2019

Copy link
Copy Markdown
Member Author

/proc/cmdline work added. It's unfortunately a bit verbose

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]>
@ashcrow

ashcrow commented Mar 27, 2019

Copy link
Copy Markdown
Member Author

squashed

@ashcrow ashcrow changed the title WIP: Add basic kernel tuning functionality Add basic kernel tuning functionality Mar 27, 2019
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 27, 2019
@ashcrow

ashcrow commented Mar 27, 2019

Copy link
Copy Markdown
Member Author

Removed WIP as it should be in a good state, though I'm going to do some manual testing shortly.

@ashcrow ashcrow changed the title Add basic kernel tuning functionality WIP: Add basic kernel tuning functionality Mar 27, 2019
@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 27, 2019
@ashcrow

ashcrow commented Mar 27, 2019 •

Copy link
Copy Markdown
Member Author

Adding it back .,.. /proc/cmdline and rpm-ostree kargs don't match when checking. They do, but after reboot which is fine for this use case.

@ashcrow ashcrow changed the title WIP: Add basic kernel tuning functionality Add basic kernel tuning functionality Mar 27, 2019
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 27, 2019
@ashcrow

ashcrow commented Mar 27, 2019

Copy link
Copy Markdown
Member Author

Ready for last set of review/verification.

Comment thread cmd/root.go
}

checkable := string(content)
if strings.Contains(checkable, arg) {

Copy link
Copy Markdown
Member

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.

@cgwalters

Copy link
Copy Markdown
Member

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 27, 2019
@cgwalters
cgwalters merged commit d95d123 into openshift:master Mar 27, 2019
Comment thread cmd/root.go
// Read and parse the file
file, err := os.Open(tuningFilePath)
// Clean up
defer file.Close()

@runcom runcom May 14, 2019 •

Copy link
Copy Markdown
Member

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#52

cgwalters added a commit to cgwalters/pivot that referenced this pull request May 14, 2019
jlebon pushed a commit that referenced this pull request May 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants