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

Skip calling rpm-ostree kargs in no-op case #586

Merged
merged 1 commit into from
Jan 22, 2024

Conversation

champtar
Copy link
Contributor

@champtar champtar commented Jan 4, 2024

If delete and append kargs args are the same in the same order there is no functional differences so we can safely skip calling rpm-ostree kargs and avoid creating a new rpm-ostree deployment.

Resolves: RHEL-20767
Fixes #585

If delete and append kargs args are the same in the same order
there is no functional differences so we can safely skip
calling rpm-ostree kargs and avoid creating a new rpm-ostree
deployment.

Resolves: RHEL-20767

Signed-off-by: Etienne Champetier <[email protected]>
Copy link
Contributor

@zacikpa zacikpa left a comment

Choose a reason for hiding this comment

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

IIUC, this change aims mainly to resolve the issue that occurs when the append list only contains already set kargs.

Rather than checking for the equality of the append_params and delete_params lists after constructing them, wouldn't it be easier to skip adding a parameter to delete_params when the currently active parameter value is equal to the one specified by append?

In other words, we would need an additional condition here which would evaluate to True only when the currently set parameter value and the one given by append differ.

@champtar
Copy link
Contributor Author

If I follow correctly, if you don't add the existing kargs to TUNED_BOOT_KARGS_DELETED, when you remove the tuned profile you will not restore the initial kargs

@zacikpa
Copy link
Contributor

zacikpa commented Jan 19, 2024

Oh, you're right about that. Then again, we don't need to restore anything if an existing karg is the same as a karg specified by the profile. So if that karg would not be returned in appended and deleted, it would not be written into BOOT_CMDLINE_TUNED_VAR and BOOT_CMDLINE_KARGS_DELETED_VAR, and it would also be ignored when un-applying the profile. Am I missing something?

I'm okay with approving this change as it is because it's simple and should work, but I feel like it could be generalized a bit more (though I agree that would require more changes).

@champtar
Copy link
Contributor Author

For some kargs ordering is important (example https://bugzilla.redhat.com/show_bug.cgi?id=1776823), i think the current implementation for the ostree path remove the kargs in whatever order and add them back in the order they appear in the profile, and my patch skips only if they are the same in the same order.
Doing partial append / delete might be problematic for ordering.
We also need to think about not breaking upgrade of existing servers.

I like my patch because it's simple enough to reason about (and to backport / hotpatch in prod), as you are okay please merge :)

Copy link
Contributor

@zacikpa zacikpa left a comment

Choose a reason for hiding this comment

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

Approving, but leaving the final merge decision on @yarda.

@yarda
Copy link
Contributor

yarda commented Jan 22, 2024

Thanks, let's go with this simple change.

@yarda yarda merged commit 05d97dc into redhat-performance:master Jan 22, 2024
14 checks passed
@champtar champtar deleted the rpm-ostree_kargs_skip branch January 22, 2024 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rpm-ostree kargs run for no-op changes
3 participants