-
Notifications
You must be signed in to change notification settings - Fork 16
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
Add VirtIO Viomem Driver support #143
Conversation
PR was rebased to current master |
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.
Why do you need double_memory
?
Nevermind. I read the help message of QEMU. |
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.
That parsing is a bit tricky. Why don't you just convert memory
into a normal JSON number so that we don't need parsing?
We need to set maxmemory that is greater than memory. I hope double memory is a simple variant and it will be enough. |
@@ -0,0 +1,8 @@ | |||
{ | |||
"name": "virtio-mem-pci", | |||
"memory_extra_param": ",maxmem=@double_memory@", |
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.
Why don't you always add maxmem
and instead make it specific to virtio-mem-pci?
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.
In the case of NetKVM (3 VM), we will have the sum of maxmem greater than the host RAM on CI servers. I want to be sure that the host always has some free memory.
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.
Is it problematic?
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.
I think it's not that strange that the sum of maxmem is greater than the host RAM.
Think of a multi-tenant machine farm; there are multiple machines, and each machine hosts multiple VMs. Also, assume that you want to scale VMs bigger without downtime.
In such a scenario, you set maxmem
of all machines to match the maximum memory size a VM can hold. The sum of maxmem
of VMs in a machine can surpass the physical memory size. Later, if too many memory is requested for a machine, some VMs on the machine will migrate to make space.
Probably some cloud vendors already do this kind of trick.
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.
I don't know the QEMU source related to maxmem
option. If you can confirm that QEMU will not allocate more than memory_size on Windows Guest without user action. I am ok.
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.
You can assume that; I believe the very purpose of maxmem
is to support a scenario I have just described, and in that case, we should never have a problem with overcomitted maxmem
.
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.
Ok. Let's assume that. We can always change this if see any problem.
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.
Let's merge changes separately because we are waiting with this PR until the new driver is ready.
Please review #308
Do you suggest to convert 4G into 4294967296? |
No, just 4. |
And suppose that we always use GB as a unit? Maybe rename key name to |
Yes. Renaming key is a nice suggestion. |
@@ -358,6 +358,7 @@ def full_replacement_list | |||
'@client_id@' => @client_id, | |||
'@workspace@' => @workspace_path, | |||
'@memory@' => "#{option_config('memory_gb')}G", | |||
'@double_memory@' => "#{2 * option_config('memory_gb')}G", |
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.
Let's have @pluggable_memory@
and @max_memory@
; @max_memory@
will be the sum of @memory@
and @pluggable_memory@
.
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.
In this case, I need to talk with the driver developer. You can see that memory-backend-ram and virtio-mem-pci have a different memory size. What is @pluggable_memory@
now 2G
or 1G
? That's why I don't prefer ideas with calculation.
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.
The same applies even now; changing the size of mem_backend
into 512M will certainly cause a trouble. Having @pluggable_memory@
only moves the place where the value 2G
is written, and allows calculating @max_memory@
.
That said, I see no reason that request-size
has to be inequal to mem_backend
size.
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.
Just checked QE command line extra_cmd= ' -object memory-backend-ram,id=vmem0,size=5G -device virtio-mem-pci,id=mem0,memdev=vmem0,node=0,requested-size=2G,indirect_desc=off,bus='+bus_num
request-size
!= mem_backend
size.
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.
It's better to ask if changing requested-size
is OK.
@akihikodaki What comments do you have in this case? |
The comment in https://github.com/HCK-CI/AutoHCK/pull/143/files#r1495953291 still applies. I have nothing else to add. |
How do you expect to see the syntax of the @max_memory@ calculation? Or do you expect this as the internal logic of AutoHCK if @pluggable_memory@ is defined? |
I expect an internal logic. |
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.
Why don't you make pluggable_memory_gb
a number defined with platform as memory_gb
is?
I am ok with making pluggable_memory_gb a number, but it doesn't relate to a platform. |
I don't think In any case, don't put it in |
Signed-off-by: Kostiantyn Kostiuk <[email protected]>
@YanVugenfirer Please wait for merge untill get answer virtio-win/kvm-guest-drivers-windows#794 (comment)