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

Dietmar Maurer dietmar at proxmox.com
Wed Jan 21 06:43:28 CET 2015


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