[pve-devel] [PATCH] memory hotplug patch v6

Alexandre DERUMIER aderumier at odiso.com
Wed Jan 21 07:50:21 CET 2015


>>I thought about using a simpler, fixed dimm mapping. For example: 

Damn, you are good ;)
I never have think at something like that.
It seem to solve all the problems :)


(just one little note: we need to keep some "static" memory (qemu -m X), for vm start,
 because dimm modules are not readeable until initramfs is loaded).


> I think it could work, but currently unplug is not implemented in qemu, 
>>We do not need unplug with above fixed dimm mappings.

I don't understand this. Why don't we need unplug ?
If we reduce the memory, we want to unplug dimm modules right ?


> and also it's possible for advanced users to specify topology manually 
> qm set vmid -dimmX size,numa=node 
>
>>Why is that required? Isn't it possible to assign that automatically (distribute 
>>among all 
>>numa nodes)?

I think we can simply hotplug the dimm on the node with less memory.
We just need to care about live migration, and assign same memory modules on same numa node.



----- Mail original -----
De: "dietmar" <dietmar at proxmox.com>
À: "Daniel Hunsaker" <danhunsaker at gmail.com>, "aderumier" <aderumier at odiso.com>
Cc: "pve-devel" <pve-devel at pve.proxmox.com>
Envoyé: Mercredi 21 Janvier 2015 06:43:28
Objet: Re: [pve-devel] [PATCH] memory hotplug patch v6

I thought about using a simpler, fixed dimm mapping. For example: 

--------------------------- 
#!/usr/bin/perl 

use strict; 
use warnings; 

my $dimm_id = 0; 
my $current_size = 0; 

my @dimm_sizes = (128, 512, 1024, 4096, 8192); # MB 

for (my $j = 0; $j < 16; $j++) { 
my $ind = ($j >= scalar(@dimm_sizes)) ? scalar(@dimm_sizes) - 1 : $j; 
my $dimm_size = $dimm_sizes[$ind]; 
for (my $i = 0; $i < 16; $i++) { 
my $name = "dimm${dimm_id}"; 
$dimm_id++; 
$current_size += $dimm_size; 
print "$name $dimm_size $current_size\n"; 
} 
$dimm_size *= 8; 
} 
------------------------- 

That generate a mapping like this: 

DIMM dimm_size memory_size 
dimm0 128 128 
dimm1 128 256 
dimm2 128 384 
dimm3 128 512 
dimm4 128 640 
.. 
dimm14 128 1920 
dimm15 128 2048 
dimm16 512 2560 
dimm17 512 3072 
dimm18 512 3584 
.. 
dimm31 512 10240 
dimm32 1024 11264 
dimm33 1024 12288 
.. 

So we need to round-up memory size to dimm boundaries, but implementing 
add/remove memory is quite simple 
with that? 

> I think it could work, but currently unplug is not implemented in qemu, 

We do not need unplug with above fixed dimm mappings. 

> I would like to test it to see if it's working fine. (I'll try to patch qemu 
> with last unplug patches from qemu mailing) 
> 
> With this we can keep a simple memory form field (but we need to fix minimum 
> increment with 128M instead 32M) 
> 
> qm set vmid -memory x (then compute needed dimm hotplug|unplug) 
> 
> and also it's possible for advanced users to specify topology manually 
> qm set vmid -dimmX size,numa=node 

Why is that required? Isn't it possible to assign that automatically (distribute 
among all 
numa nodes)? 



More information about the pve-devel mailing list