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

Dietmar Maurer dietmar at proxmox.com
Wed Jan 21 07:10:41 CET 2015


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

The following create a better mapping, and also shows the dimm size
a percentage of whole memory.

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

use strict;
use warnings;

my $dimm_id = 0;
my $current_size = 0;
my $dimm_size = 128;

for (my $j = 0; $j < 16; $j++) {
    for (my $i = 0; $i < 16; $i++) {
	my $name = "dimm${dimm_id}";
	$dimm_id++;
	$current_size += $dimm_size;
	my $per = (100*$dimm_size)/$current_size;
	printf ("%10s %10d %10d %10.2f\n", $name, $dimm_size,
		 $current_size, $per);
    } 
    $dimm_size *= 2;
}
-----------------------------------




More information about the pve-devel mailing list