-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[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
[release-1.3] mem-hotplug: enable only for VMs with memory >= 1Gi #12328
Conversation
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)
@acardace: The following tests failed, say
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
[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 |
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