runtime: Enable file based backend#1657
Conversation
|
/test |
| # result in memory pre allocation | ||
| #enable_hugepages = true | ||
|
|
||
| # Enable file based guest memory support. The default is an empty string which |
There was a problem hiding this comment.
This is making the qemu config file deviate further from the firecracker one. Is this change qemu specific? If so, please could you mention that in the commit to make it clear.
Related: discussions on breaking up the config file into fragments - #1648
There was a problem hiding this comment.
Good point. Let me see if this at all will work with firecracker and then comment back here.
There was a problem hiding this comment.
@jodh-intel verified with @mcastelino that this feature will not work on firecracker. I have since removed the config from the firecracker hypervisor invocation and cleaned up the code. Will do a follow-on document update regarding this and hugepages.
| return incoming | ||
| } | ||
|
|
||
| func (q *qemu) setupFileBackedMem(knobs *govmmQemu.Knobs, memory *govmmQemu.Memory) { |
There was a problem hiding this comment.
There are now 3 users:
- VM templating, see setupTemplate()
- virtio-fs
- Explicit file_mem_backend in configuration.toml
Additionally, all other vhost-user devices also require this setting if hugepages is disabled. Perhaps it should be enabled automatically for all vhost-user devices, not just virtio-fs?
When VM templating is enabled together with virtio-fs the MemoryPath is ignored in favor of FileBackedMemRootDir. Did you check that VM templating still works in this case?
There was a problem hiding this comment.
@ganeshmaharaj We also have a gap around memory hotplug. Our memory hotplug model should also switch over to file_mem_backend for all hotplugged dimms also when this is flipped. All the vhost-user backends may or may not tolerate this, but we should ensure we do not end up with a mix of file backed and no file backed DIMMs.
There was a problem hiding this comment.
@ganeshmaharaj just to be clear, when you flip this flag every DIMM should be file backed. (This also applies to huge pages). So this will be a good time to fix hotplug handling overall. It can be in a separate PR as this feature is experimental in this release. But before we move it out of experimental we need to make the change as kubernetes will break as it relies heavily on memory hotplug support today.
/cc @dagrh
There was a problem hiding this comment.
@mcastelino It is a common use case for vm templating to mix file backed and non-file backed DIMMs. When we unmix them, vm templating's initial memory path should be excluded since it is always file backed.
There was a problem hiding this comment.
@bergwolf fair enough. However vhost-user backends will break if we do not make them all file based. So when vhost-user is used, we should default all DIMMs to file based. When it is not in use we should allow the mixing.
However it may just be easier to go one way or the other. (If the overhead is marginal)
There was a problem hiding this comment.
@mcastelino Once vm template's initial memory path is excluded, I'm all for it to never mix the two.
There was a problem hiding this comment.
Have fixed the choices on multiple scenarios. VM Templating gets the high priority off all. If VM templating is not enabled, the user's filebacking location will be used and fallback is /dev/shm. @stefanha I was not able to get VM templating to work with virtio-fs. That is now next in the list of things to tackle once this patch lands. @mcastelino @bergwolf so will memory hotplug and removing the mixing of memory backends.
There was a problem hiding this comment.
@bergwolf @ganeshmaharaj in summary if VM templating is enabled then virtio-fs cannot be used. Actually any vhost-user implementation cannot be used.
If I understand right this is due to the fact that the file backing the templated RAM is setup with share=off. Is that a correct summary. So this is independent of hotplug right?
Can we add this as a known limitation to the documentation?
There was a problem hiding this comment.
@ganeshmaharaj @mcastelino I think it is a problem due to kata/govmm implementation. vm template is using its own dimm, and virtio-fs is using its own dimm. Their share property is independent to each other. I don't see why we cannot make them work together.
|
Tested here, it'd solved my problem, so looking for this been merged ASAP :) |
9ef20dd to
42a17ff
Compare
|
/test |
|
/test-power |
281a4aa to
9a7fd4d
Compare
A file based memory backend mapped to the host, fot eg: '/dev/shm' will be used by virtio-fs for performance reasons. This change is a generic implementation of that for kata. This will be enabled default for virtio-fs negating the need to enable hugepages in that scenario. This option can be used without virtio-fs by setting 'file_mem_backend' to the location in the configuration file. Default value is an empty string. Fixes: kata-containers#1656 Signed-off-by: Ganesh Maharaj Mahalingam <ganesh.mahalingam@intel.com>
9a7fd4d to
a41894d
Compare
|
/test |
Codecov Report
@@ Coverage Diff @@
## master #1657 +/- ##
==========================================
- Coverage 54.57% 54.56% -0.01%
==========================================
Files 106 106
Lines 12765 12792 +27
==========================================
+ Hits 6966 6980 +14
- Misses 4966 4975 +9
- Partials 833 837 +4 |
|
@ganeshmaharaj any updates? Seems it's approved but a test failing. |
|
@raravena80 i believe the fedora failure is a known one that folks have been debugging now to figure out the rootcause. There are multiple bugs/PRs towards this. kata-containers/tests#1449, kata-containers/tests#1531 |
|
i believe this patch is ready to be merged into the tree if there are no objections. cc @kata-containers/runtime |
A file based memory backend mapped to the host, fot eg: '/dev/shm' will
be used by virtio-fs for performance reasons. This change is a generic
implementation of that for kata. This will be enabled default for
virtio-fs negating the need to enable hugepages in that scenario. This
option can be used without virtio-fs by setting 'file_mem_backend' to
the location in the configuration file. Default value is an empty
string.
Fixes: #1656
Signed-off-by: Ganesh Maharaj Mahalingam ganesh.mahalingam@intel.com