Skip to content

[release-1.3] mem-hotplug: enable only for VMs with memory >= 1Gi #12328

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

Merged
merged 4 commits into from
Jul 13, 2024

Conversation

acardace
Copy link
Member

Manual backport of #12212.

Fixes #

Why we need it and why it was done in this way

The following tradeoffs were made:

The following alternatives were considered:

Links to places where the discussion took place:

Special notes for your reviewer

Checklist

This checklist is not enforcing, but it's a reminder of items that could be relevant to every PR.
Approvers are expected to review this list.

Release note

enable only for VMs with memory >= 1Gi

Sorry, something went wrong.

acardace added 4 commits July 11, 2024 16:14
The 1GiB mark is chosen as a tradeoff, it is enough
memory for the guest kernel to allocate its internal data
structures and to allocate the SWIOTLB.
It also means we can memory map all PCI devices
as they're memory mapped in the first 1Gi (PCI hole).

If there are 32bit devices that need to do DMA,
the kernel will allocate memory for the SWIOTLB, which is a
bounce buffer to address memory after the 4Gi Mark, the
SWIOTLB in Linux at the moment of this commit is 64MB and
this causes an issue for the kernel with VMs with very small
amounts of memory, if not enough memory is available this can
lead to the guest kernel panicking while trying to allocate memory.

This SWIOTLB issue is present when setting `maxMemory` (which is set in
all VMs when `LiveUpdate` is used as the `vmRolloutStrategy`) in the
XML domain of the VM because the kernel will have to allow DMA to happen
also for virtio-mem hotplugged memory, which is always mapped after the
4Gi mark and thus always needs SWIOTLB for devices that use 32bit
addresses.

Signed-off-by: Antonio Cardace <acardace@redhat.com>
(cherry picked from commit 6a3004c)
This helps properly testing memory hotplug since
Alpine v3.20.1 uses Linux v6.

Signed-off-by: Antonio Cardace <acardace@redhat.com>
(cherry picked from commit 663937a)
Alpine v3.20 uses Linux v6 which is fully
compatible with virtio-mem.

Signed-off-by: Antonio Cardace <acardace@redhat.com>
(cherry picked from commit 071c465)
This is the minimum amount of memory required by Alpine Linux.

Signed-off-by: Antonio Cardace <acardace@redhat.com>
(cherry picked from commit 1dec670)
@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 sig/buildsystem Denotes an issue or PR that relates to changes in the build system. labels Jul 11, 2024
@kubevirt-bot
Copy link
Contributor

kubevirt-bot commented Jul 11, 2024

@acardace: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-kubevirt-conformance-arm64 8068530 link false /test pull-kubevirt-conformance-arm64-1.3
pull-kubevirt-check-tests-for-flakes 8068530 link false /test pull-kubevirt-check-tests-for-flakes-1.3

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. I understand the commands that are listed here.

Copy link
Contributor

@enp0s3 enp0s3 left a comment

Choose a reason for hiding this comment

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

/approve

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Jul 13, 2024
@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: enp0s3

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 Jul 13, 2024
@kubevirt-bot kubevirt-bot merged commit 0ef7e37 into kubevirt:release-1.3 Jul 13, 2024
35 of 37 checks passed
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. sig/buildsystem Denotes an issue or PR that relates to changes in the build system. size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants