add KSM and THP tuning opt-ins - #288
Conversation
|
Hi @michalskrivanek. Thanks for your PR. I'm waiting for a openshift-virtualization member to verify that this patch is reasonable to test. If it is, they should reply with Tip We noticed you've done this a few times! Consider joining the org to skip this step and gain Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
@fabiand @tiraboschi wdyt? tried to balance the CPU and the scanning rate and the (currently inevitable) conflict between KSM and THP. corresponding metrics PR openshift-virtualization/kubevirt-metrics-exporter#18 |
|
/ok-to-test |
| spec: | ||
| {{- if $ksmZeroOnly }} | ||
| ksmConfiguration: null | ||
| {{- end }} |
There was a problem hiding this comment.
I'm wondering if we should do the opposite and threat HCO CR as read-only honoring the new annotation only when ksmConfiguration is null.
There was a problem hiding this comment.
zero-only-pages conflict with kubevirt's KSM management. I think it's the right direction, overriding possible full KSM config when zero-only-pages are requested. Or did you mean something else?
2ef13cc to
022acfd
Compare
|
❌ Generated Files Verification Failed One or more generated files in this PR are out of sync:
Please regenerate the files locally and commit the changes. |
022acfd to
e0ebef7
Compare
|
❌ Generated Files Verification Failed One or more generated files in this PR are out of sync:
Please regenerate the files locally and commit the changes. |
e0ebef7 to
22f5cce
Compare
22f5cce to
31acc85
Compare
480a10d to
fdc72ff
Compare
Signed-off-by: Michal Skrivanek <michal.skrivanek@redhat.com> Assisted-by: claude-4.6-opus
fdc72ff to
ba17eeb
Compare
cc24563 to
115ee19
Compare
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
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
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
Signed-off-by: Michal Skrivanek <michal.skrivanek@redhat.com> Assisted-by: claude-4.6-opus
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
115ee19 to
5216dea
Compare
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: 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 |
|
/cherry-pick release-4.22 |
|
@tiraboschi: once the present PR merges, I will cherry-pick it on top of DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
0171035
into
openshift-virtualization:main
|
@tiraboschi: #288 failed to apply on top of branch "release-4.22": DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
add opt-in MachineConfigs for KSM zero-only and THP tuning
Two new opt-in features gated on HCO annotations:
Enables KSM in redhat_only_zero_pages mode with adaptive scan rate.
Formula: pages_to_scan=1000, sleep=min(50, 25600/node_gb).
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.