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

Alexandre DERUMIER aderumier at odiso.com
Wed Jan 21 08:17:34 CET 2015


I think we can also add numa nodes in the mapping,
like this;


#!/usr/bin/perl 

use strict;
use warnings;

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

my $node = 0;

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;
        if($node < $sockets-1) {
            $node++;
        }else {
           $node = 0;
        }
        printf ("%10s %10d %10d %10.2f %d\n", $name, $dimm_size,
                 $current_size, $per, $node);
    }
    $dimm_size *= 2;
}


----- 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 07:10:41
Objet: Re: [pve-devel] [PATCH] memory hotplug patch v6

> 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