[release-4.22] add KSM and THP tuning opt-ins - #316
Merged
openshift-merge-bot[bot] merged 6 commits intoAug 19, 2026
Merged
Conversation
Signed-off-by: Michal Skrivanek <michal.skrivanek@redhat.com> Assisted-by: claude-4.6-opus (cherry picked from commit 4e127b2)
Introduce TemplateParams (map[string]string) on AssetMetadata, passed to templates as .Params. This allows metadata.yaml to parameterize shared templates without engine changes per use case. Add ConditionTypeTopology to gate assets on cluster topology fields (e.g. hasSchedulableMasters), enabling conditional inclusion of assets for compact/schedulable-master clusters. Signed-off-by: Michal Skrivanek <michal.skrivanek@redhat.com> Assisted-by: claude-4.6-opus (cherry picked from commit 13ecf25)
Allow assets to be gated on whether an HCO spec field is configured. When the field is absent, null, or an empty map, the condition evaluates to true (asset is included). This supports opt-in assets that should only apply when the user has not explicitly configured the feature in HCO. Signed-off-by: Michal Skrivanek <michal.skrivanek@redhat.com> Assisted-by: claude-4.6-opus (cherry picked from commit 5f4d2cd)
Add KSM zero-pages-only and THP madvise tuning as opt-in MachineConfigs, gated by annotations and hco-field-unconfigured conditions. Templates use .Params.role from template_params to support both worker and master roles from a single shared template. Master variants are conditionally included via topology hasSchedulableMasters condition. Includes cluster-monitoring ConfigMap for KSM PrometheusRule. Signed-off-by: Michal Skrivanek <michal.skrivanek@redhat.com> Assisted-by: claude-4.6-opus (cherry picked from commit 2a98741)
Signed-off-by: Michal Skrivanek <michal.skrivanek@redhat.com> Assisted-by: claude-4.6-opus (cherry picked from commit 0fbfbda)
Replace static 04-psi-enable.yaml and conditional 05-psi-enable-master.yaml.tpl with a single shared template using .Params.role. Master variant is now gated by topology hasSchedulableMasters condition in metadata, consistent with KSM and THP assets. Signed-off-by: Michal Skrivanek <michal.skrivanek@redhat.com> Assisted-by: claude-4.6-opus (cherry picked from commit 5216dea)
Contributor
|
/lgtm |
Contributor
|
i guess i can't.... |
Member
Author
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: michalskrivanek, tiraboschi The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
openshift-merge-bot
Bot
merged commit Aug 19, 2026
ccd1450
into
openshift-virtualization:release-4.22
6 of 8 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
add opt-in MachineConfigs for KSM zero-only and THP tuning
Two new opt-in features gated on HCO annotations:
ksm-zero-only (platform.kubevirt.io/enable-ksm-zero-only):
Enables KSM in redhat_only_zero_pages mode with adaptive scan rate.
Formula: pages_to_scan=1000, sleep=min(50, 25600/node_gb).
thp-tuning (platform.kubevirt.io/enable-thp-tuning):
Sets THP to madvise and tunes khugepaged for KVM workloads.
Formula: pages_to_scan=130000, sleep=1000+64000/node_gb.
Both deploy a Python script via systemd oneshot that reads node
memory size and writes computed parameters to sysfs at boot.
This is a manual cherry-pick of #288