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

Fix: Align Reenlightenment flows between converter.go and template.go #8740

Merged

Conversation

iholder101
Copy link
Contributor

@iholder101 iholder101 commented Nov 8, 2022

What this PR does / why we need it:
This PR aims to fix an inconsistency regarding re-enlightenment VMs and TSC frequency.

While the converter.go's logic checked whether we have topology hints defined and that tsc frequency is required (which is the right thing to do), template.go logic did not check the later. The both flows are now aligned, with IsManualTSCFrequencyRequired() being the sole source of truth.

BZ: https://bugzilla.redhat.com/show_bug.cgi?id=2139896

Release note:

Fix: Align Reenlightenment flows between converter.go and template.go

@kubevirt-bot kubevirt-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. size/L labels Nov 8, 2022
@iholder101
Copy link
Contributor Author

/cc @vladikr

Entry("and consider graphics overhead if it is not set on arm64", "arm64", nil, 469),
Entry("and consider graphics overhead if it is set to true on arm64", "arm64", True(), 469),
Entry("and not consider graphics overhead if it is set to false on arm64", "arm64", False(), 453),
Entry("and consider graphics overhead if it is set to true on arm64", "arm64", pointer.Bool(true), 469),
Copy link
Member

Choose a reason for hiding this comment

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

:)

@vladikr
Copy link
Member

vladikr commented Nov 8, 2022

Great!
Thanks @iholder-redhat.
Looks good to me.

/approve

@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vladikr

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubevirt-bot kubevirt-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 8, 2022
@vladikr
Copy link
Member

vladikr commented Nov 8, 2022

/cc @acardace

@vladikr
Copy link
Member

vladikr commented Nov 10, 2022

/hold

It looks like any frequency can be supported on a CPU that has an invtsc flag.
In that case, we could make the scheduling requirement more robust.

@kubevirt-bot kubevirt-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 10, 2022
@vladikr
Copy link
Member

vladikr commented Nov 10, 2022

/hold

It looks like any frequency can be supported on a CPU that has an invtsc flag. In that case, we could make the scheduling requirement more robust.

Everything looks fine :) The low freq. is being added as a schedulable label on nodes with scalable tsc. [1]
[1]

func CalculateTSCLabelDiff(frequenciesInUse []int64, frequenciesOnNode []int64, nodeFrequency int64, scalable bool) (toAdd []int64, toRemove []int64) {

@vladikr
Copy link
Member

vladikr commented Nov 10, 2022

/hold cancel

@kubevirt-bot kubevirt-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 10, 2022
@acardace
Copy link
Member

/restest-required

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Nov 15, 2022
@acardace
Copy link
Member

/test pull-kubevirt-e2e-k8s-1.24-sig-compute-root

@acardace
Copy link
Member

/cherrypick release-0.58

@kubevirt-bot
Copy link
Contributor

@acardace: once the present PR merges, I will cherry-pick it on top of release-0.58 in a new PR and assign it to you.

In response to this:

/cherrypick release-0.58

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/test-infra repository.

While the converter.go logic checked whether we have topology hints
defined and that tsc frequency is required (which is the right thing
to do), template.go logic did not check the later.

In addition, improve IsManualTSCFrequencyRequired() to also check
whether topology hints are defined.

Signed-off-by: Itamar Holder <iholder@redhat.com>
Signed-off-by: Itamar Holder <iholder@redhat.com>
Signed-off-by: Itamar Holder <iholder@redhat.com>
…e updated

Signed-off-by: Itamar Holder <iholder@redhat.com>
That's how we can distinguish between us waiting for a TSC frequency
and knowing there is no TSC frequency information, hence we can
stop waiting for it.

This is necessary, since the vmi controller executes "sync()" and
"updateStatus()" in every control loop. If TSC frequency is required,
sync() would wait until topology hints would be set up by
updateStatus(). Today, updateStatus() doesn't update the topology
hints at all if no TSC frequency information exists, therefore
sync will continue waiting forever and the VM wouldn't be able
to start.

Signed-off-by: Itamar Holder <iholder@redhat.com>
…gy hints are updated

Signed-off-by: Itamar Holder <iholder@redhat.com>
…ined

Signed-off-by: Itamar Holder <iholder@redhat.com>
@iholder101 iholder101 force-pushed the fix/reenlightenment-align-flows branch from 9a723e8 to c9a8668 Compare November 15, 2022 16:34
@kubevirt-bot kubevirt-bot removed the lgtm Indicates that a PR is ready to be merged. label Nov 15, 2022
@acardace
Copy link
Member

/lgtm

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Nov 15, 2022
@kubevirt-bot kubevirt-bot merged commit 40b4770 into kubevirt:main Nov 15, 2022
40 of 41 checks passed
@kubevirt-bot
Copy link
Contributor

@acardace: #8740 failed to apply on top of branch "release-0.58":

Applying: Fix: Align Reenlightenment flows between converter.go and template.go
Applying: Unit test: ensure tsc label is set when needed
Using index info to reconstruct a base tree...
M	pkg/virt-controller/services/BUILD.bazel
M	pkg/virt-controller/services/template_test.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/virt-controller/services/template_test.go
Auto-merging pkg/virt-controller/services/BUILD.bazel
Applying: Unit test: Refactor
Applying: make sure vmi controller does not create pod before topology hints are updated
Applying: Set frequency as 0 if TSC frequency is available on the cluster
Applying: unit test: make sure vmi controller does not create pod before topology hints are updated
Using index info to reconstruct a base tree...
M	pkg/virt-controller/watch/vmi_test.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/virt-controller/watch/vmi_test.go
Applying: Functest: Ensure reenlightenment VMs have tsc label and frequency defined
Using index info to reconstruct a base tree...
A	tests/hyperv_test.go
Falling back to patching base and 3-way merge...
CONFLICT (modify/delete): tests/hyperv_test.go deleted in HEAD and modified in Functest: Ensure reenlightenment VMs have tsc label and frequency defined. Version Functest: Ensure reenlightenment VMs have tsc label and frequency defined of tests/hyperv_test.go left in tree.
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0007 Functest: Ensure reenlightenment VMs have tsc label and frequency defined
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherrypick release-0.58

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/test-infra repository.

@iholder101
Copy link
Contributor Author

/cherrypick release-0.53

@kubevirt-bot
Copy link
Contributor

@iholder101: #8740 failed to apply on top of branch "release-0.53":

Applying: Fix: Align Reenlightenment flows between converter.go and template.go
Using index info to reconstruct a base tree...
M	pkg/virt-controller/services/template.go
M	pkg/virt-launcher/virtwrap/converter/converter.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/virt-launcher/virtwrap/converter/converter.go
Auto-merging pkg/virt-controller/services/template.go
CONFLICT (content): Merge conflict in pkg/virt-controller/services/template.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Fix: Align Reenlightenment flows between converter.go and template.go
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherrypick release-0.53

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/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants